Oct 24th, 2012, 11:33 AM
Originally Posted by lucasward
I have similar kind of situation. In my Spring Batch application, I have defined two transaction manager and in transaction manager bean declarations, I have used <qualifier> tag to differentiate these transaction manger in my transactional DAO class.
First txn manager:
<bean id="transactionManager" class="org.springframework.orm.hibernate3.Hibernat eTransactionManager" >
<property name="sessionFactory" ref="crmsSssionFactory" />
Second txn manager:
<bean id="cddprofileTxnManager" class="org.springframework.orm.hibernate3.Hibernat eTransactionManager" >
<property name="sessionFactory" ref="cddProfileSessionFactory" />
During step execution, I need to update data into two databases.First database is same as what I use to store batch meta data. This one uses the transaction manager used by step execution which is "transactionManager". Second db one uses another transaction manager - cddprofileTxnManager. It is committing db updates in second DB, but roll back is not happening in case of exception. Is there anything I can do without using JTA?My application doesn't use any kind of Java EE container.
Oct 26th, 2012, 12:47 PM
Without using global transactions of some kind, you will run into the issues of having one transaction's failure not rolling back the other's.