Sunday
May022010
Configuring Open Source JTA Transaction Managers with Spring
Sunday, May 2, 2010 at 9:23PM This blog post records in one place the Spring configuration required for each of the four most commonly used open source standalone transaction managers:
For Arjuna / JBossTS, apply the following configuration.:
<bean id="jbossTS" class="com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionManagerImple" />
<bean id="jbossUserTransaction"
class="com.arjuna.ats.internal.jta.transaction.arjunacore.UserTransactionImple" />
<bean id="txManager" class="org.springframework.transaction.jta.JtaTransactionManager">
<property name="transactionManager" ref="jbossTS" />
<property name="userTransaction" ref="jbossUserTransaction" />
</bean>
For JOTM, apply the following:
<bean id="jotm" class="org.springframework.transaction.jta.JotmFactoryBean" />
<bean id="txManager" class="org.springframework.transaction.jta.JtaTransactionManager">
<property name="userTransaction" ref="jotm" />
<property name="allowCustomIsolationLevels" value="true" />
</bean>
For Atomikos, the following configuration can be used:
<bean id="atomikos" class="com.atomikos.icatch.jta.UserTransactionManager"
init-method="init" destroy-method="close">
<property name="forceShutdown" value="false" />
</bean>
<bean id="atomikosUserTransaction" class="com.atomikos.icatch.jta.UserTransactionImp">
<property name="transactionTimeout" value="300" />
</bean>
<bean id="txManager" class="org.springframework.transaction.jta.JtaTransactionManager">
<property name="transactionManager" ref="atomikos" />
<property name="userTransaction" ref="AtomikosUserTransaction" />
</bean>
Finally, for Bitronix you can use the following:
<bean id="bitronixConfig" factory-method="getConfiguration"
class="bitronix.tm.TransactionManagerServices">
<property name="serverId" value="spring-btm" />
</bean>
<bean id="bitronix" factory-method="getTransactionManager"
class="bitronix.tm.TransactionManagerServices" depends-on="bitronixConfig"
destroy-method="shutdown" />
<bean id="txManager" class="org.springframework.transaction.jta.JtaTransactionManager">
<property name="transactionManager" ref="bitronix" />
<property name="userTransaction" ref="bitronix" />
</bean>
Chris |
Post a Comment | in
Spring,
Transactions
Spring,
Transactions 
Reader Comments