Atomikos Forum

Atomikos not rolling back with JNDI

Hi,

I am trying to configure atomikos distributed transaction using Spring and JNDI. When the AtomikosDataSourceBean is configured as a spring bean, the transaction works as expected (rolling back on any exception). But when i obtain the datasource through JNDI lookup the transaction does not roll back even if there is any exception. IT commits as soon as any statement is executed.

Is there any good documentation for Atomikos JNDI Configuration? I referred http://www.atomikos.org/Documentation/Tomcat6Integration33 and cofigured as mentioned.

Spring bean configuration:
<bean id="jtaDataSource"                                          class="com.atomikos.jdbc.AtomikosDataSourceBean" 
  init-method="init"
  destroy-method="close"
  lazy-init="false"
 >
<property name="uniqueResourceName" value="jtaDataSource" />
<property name="xaDataSourceClassName" value="oracle.jdbc.xa.client.OracleXADataSource" />
<property name="xaProperties">
<props>
<prop key="URL">${someurl}</prop>
<prop key="user">${someusername}</prop>
<prop key="password">${somepassword}</prop>
</props>
</property>
<property name="maxPoolSize" value="50" />
<property name="borrowConnectionTimeout" value="30000" />
<property name="testQuery" value="select 1 from dual" />
</bean>

JNDI lookup:
<bean id="jtaDataSource"
class="org.springframework.jndi.JndiObjectFactoryBean"
scope="singleton">
<property name="jndiName">
<value>DataSourceJTA</value>
</property>
<property name="resourceRef" value="true"/>
</bean>

JNDI resource:
<Resource name="DataSourceJTA" auth="Container"  type="com.atomikos.jdbc.AtomikosDataSourceBean"
factory="com.atomikos.tomcat.BeanFactory"
uniqueResourceName="DataSourceJTA"
xaDataSourceClassName="oracle.jdbc.xa.client.OracleXADataSource"
xaProperties.user="sysadm"
xaProperties.password="sysadm"
xaProperties.URL="someURL"
maxPoolSize ="50"
borrowConnectionTimeout="30000"
testQuery="select 1 from dual"
/>

Transaction Manager beans:
<bean id="atomikosTransactionManager"
class="com.atomikos.icatch.jta.UserTransactionManager"
init-method="init"
destroy-method="close"
>
<property name="forceShutdown" value="true" />
</bean>

<bean id="atomikosUserTransaction"
class="com.atomikos.icatch.jta.UserTransactionImp"
>
<property name="transactionTimeout" value="300" />
</bean>

<bean id="jtaTransactionManager"
class="org.springframework.transaction.jta.JtaTransactionManager"
>
<property name="transactionManager" ref="atomikosTransactionManager" />
<property name="userTransaction" ref="atomikosUserTransaction" />
</bean>
Sathya Priya Send private email
Tuesday, August 04, 2009
 
 
Hi,

Thanks for getting back to us. We don't have an answer right away but we promise we'll look at this in more detail for a next release.

HTH
Guy Pardon Send private email
Monday, August 17, 2009
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics