Hey,
I have this configuration:
How to start transactions when ProService methods start.Code:<bean id="proDao" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"> <property name="transactionManager" ref="txManager"/> <property name="target" ref="proDaoTarget"/> <property name="transactionAttributes"> <props> <prop key="save*">PROPAGATION_REQUIRED</prop> <prop key="remove*">PROPAGATION_REQUIRED</prop> <prop key="load*">PROPAGATION_REQUIRED</prop> <prop key="delete*">PROPAGATION_REQUIRED</prop> </props> </property> </bean> <bean id="proService" class="com.ProServiceImpl"> <property name="proDao" ref="proDao"/> </bean>
Consider this service method:
doSomething() statements should be grouped inside a transactionCode:public void doSomething() { /* proDao load object1 proDao load object2 connect object1 to object2 save changed to the database */ }
Any ideas?
My environment:
Spring 2.5
Hibernate 3
Thanks in advance.


Reply With Quote