I have the follwing code:
Code:<bean id="txTemplateProxy" abstract="true" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"> <property name="transactionManager"><ref bean="transactionManager"/></property> <property name="transactionAttributes"> <props> <prop key="insert*">PROPAGATION_NOT_SUPPORTED</prop> <prop key="_insert*">PROPAGATION_REQUIRED</prop> </props> </property> </bean> <bean id="userService" parent="txTemplateProxy"> <property name="target"> <bean class="eg.UserServiceImpl"></bean> </property> </bean>My question is when I called the _insert() method from insert(), it's not in 'PROPAGATION_REQUIRED' transaction, but PROPAGATION_NOT_SUPPORTED.Code:public class UserServiceImpl implements UserService { public void insert() { this._insert(); // some business logic... } public void _insert() { // some business logic... } }
When I call it like this "context.getBean("userService")._insert();" instead of "this._insert()", it's called as 'PROPAGATION_REQUIRED'.
What I want to do is when I called this._insert() method from same instance, I want to run other transaction without calling like "context.getBean("userService")._insert();".
sorry my bad english.


Reply With Quote