Hi.. I have been working on Spring managed transaction without problem. I used a DataSourceTransactionManager for all the iBATIS DAOs:
and a TransactionProxyFactoryBean for all the service:Code:<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean" singleton="true"> <property name="jndiName"> <value>jdbc/DB</value> </property> </bean> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource"><ref bean="dataSource"/></property> </bean>
All operation within a service used the same transaction and rollback correctly if necessary.Code:<bean id="txProxyTemplate" abstract="true" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"> <property name="transactionManager"> <ref bean="transactionManager" /> </property> <property name="transactionAttributes"> <props> <prop key="*">PROPAGATION_REQUIRED,-Exception</prop> </props> </property> </bean>
However, when I put the service in a SLSB, things go wrong. Shown below is the scenario:
1) MDB (CMT,Supported)
1.1) Service A (using the same "txProxyTemplate" configuration as shown above)
1.1.1) do an update in database by Service B (and iBATIS DAO B)
1.1.2) SLSB C (CMT,Supported)
1.1.2.1) Service C (using the same "txProxyTemplate confiruation too)
1.1.2.1.1) Got error and throw a checked Exception
1.1.2) catch the checked Exception but the database update operation didn't rollback
I tried to fixed the problem by using JtaTransactionManager:
This time, the database update operation was rollbacked. However, instead of throwing the checked Exception, a javax.transaction.TransactionRolledbackException exception was thrown by SLSB C. Does anyone know how to configurate Spring and SLSB property to successfully propagate transaction between them?Code:<bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager"> </bean>
I am using Spring 1.2.2 and WebLogic Server 8.1
Thanks.
Koala Lam


Reply With Quote