Question
How to configure a JtaTransactionManager object with allowCustomIsolationLevels set to true using Spring so that Spring configuration can be used on multiple application servers?
Background:
I have an application that is currently ending with JBossAS and I am trying to run it in WebSphere. The only problem I'm currently facing is getting the right JTA Transaction Manager with the appropriate settings.
Here is the old setting
<bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager"> <property name="transactionManagerName"> <value>java:/TransactionManager</value> </property> <property name="allowCustomIsolationLevels" value="true" /> </bean>
This worked because JBossAS has a JTA Transaction Manager defined in the JNDI location java: / TransactionManager. However, WebSphere does not have the same JNDI location.
Spring 2.5.x provides a way to get JTA Transaction Manager in a generic way.
<tx:jta-transaction-manager />
This gets the JtaTransactionManager object and defines it as a bean with transactionManager identifier.
I looked at the Spring TX diagram, but the only option available is to set a specific level of isolation, but not just for the custom levels to be used (as defined elsewhere). How to set allowCustomIsolationLevels property using tx tag: jta-transaction-manager?
source share