Hi,
I think the current approach to the handling of exceptions that Spring.Java can be applied here. This way specifics method name as key and the trio of propagation properties, isolation level, and exception type to commit on as shown below
Code:
<property name="TransactionAttributes">
<name-values>
<add key="PerformOperationsOnObject*" value="PROPAGATION_REQUIRED, +ExceptionTypeOneToCommitOn"/>
<add key="Create*" value="PROPAGATION_REQUIRED, +ExceptionTypeTwoToCommitOn"/>
</name-values>
</property>
If you needed to handle the case of the same named DAO method having different exception policy, I'd say to change the code to be more consistent although nothing prevents you from specifiying individual transaction attribute for each DAO. Common usage puts them in a base abstract configuration object and then each DAO object inherits form that. To take from a Java example, cause don't have a C# one easily available.
Code:
<bean id="baseTransactionProxy" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"
abstract="true">
<property name="transactionManager" ref="transactionManager"/>
<property name="transactionAttributes">
<props>
<prop key="create*">PROPAGATION_REQUIRED,-BusinessServiceException</prop>
<prop key="delete*">PROPAGATION_REQUIRED,-BusinessServiceException</prop>
<prop key="update*">PROPAGATION_REQUIRED,-BusinessServiceException</prop>
<prop key="do*">PROPAGATION_REQUIRED,-BusinessServiceException</prop>
<prop key="add*">PROPAGATION_REQUIRED,-BusinessServiceException</prop>
<prop key="remove*">PROPAGATION_REQUIRED,-BusinessServiceException</prop>
<prop key="find*">PROPAGATION_REQUIRED,readOnly,-BusinessServiceException</prop>
<prop key="load*">PROPAGATION_REQUIRED,readOnly,-BusinessServiceException</prop>
</props>
</property>
</bean>
And then each DAO would have something like
Code:
<bean id="EntitlementDao" parent="baseTransactionProxy">
<property name="target" ref="EntitlementDaoTarget"/>
</bean>
where EntitlementDaoTarget is your POJO.
Whaddya think.
Cheers,
Mark