Transaction demarcation to service level
Hi mdenium,
Quote:
Originally Posted by
mdeinum
Normally you want to define your transactions on the Service layer and not on yuor database layer. that way your business method is transactional. So pull-up your transaction demarcation one level from dao to service.
Plz guide me, whether I am in the right track or not..
suppose I have a bean RegistrationController.java of the service layer, in which I am calling the three methods then I have to configure
Code:
<bean id="regController"
class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager">
<ref bean="transactionManager" />
</property>
<property name="target">
<ref bean="regControllerTarget" />
</property>
<property name="transactionAttributes">
<!-- define the transaction specs here -->
<props>
<prop key="addGroupSafe">PROPAGATION_REQUIRED</prop>
</props>
</property>
</bean>
<bean id="regControllerTarget"
class="MyPackage.RegistrationController">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
Thanks & Regards,
S. Anand Mohan.