Atomikos Forum

tm.out and transaction files problem

Hi,

We are using atomikos 3.7.1 with Java Springs and hibernate. We are performing a global XA transaction involving a JMS send and JDBC update. However we see that when our application is stopped in the middle of processing an XA transaction, a hanging transaction gets created in the database and is blocking any activity on the dataserver. When we run our application again, we are getting a Heuristic exception. Below is the snapshot of the exception. To Solve this issue, we created a DB script running dbcc command in database to rollback these hanging transactions.
Sometimes we see that we need to remove the below files for our application to run.

tm.out
tm.out.lck
tmlog.lck
tmlog34.log

Any idea how can we run our application without removing these files each time.

Exception
----------
WARN  [16 Jun 2011 11:48:06:281] atomikos                      - XAResourceTransaction com.atomikos.spring.jdbc.tm0000400009com.atomikos.spring.jdbc.tm8: no XAResource to commit - the required resource is probably not yet intialized?
WARN  [16 Jun 2011 11:48:06:281] atomikos                      - Unexpected error in commit
com.atomikos.icatch.HeurHazardException: Heuristic Exception
    at com.atomikos.datasource.xa.XAResourceTransaction.commit(XAResourceTransaction.java:756)
    at com.atomikos.icatch.imp.CommitMessage.send(CommitMessage.java:73)
    at com.atomikos.icatch.imp.PropagationMessage.submit(PropagationMessage.java:111)
    at com.atomikos.icatch.imp.Propagator$PropagatorThread.run(Propagator.java:87)
    at com.atomikos.icatch.imp.Propagator.submitPropagationMessage(Propagator.java:66)
    at com.atomikos.icatch.imp.HeurHazardStateHandler.onTimeout(HeurHazardStateHandler.java:120)
    at com.atomikos.icatch.imp.CoordinatorImp.alarm(CoordinatorImp.java:1105)
    at com.atomikos.timing.PooledAlarmTimer.notifyListeners(PooledAlarmTimer.java:112)
    at com.atomikos.timing.PooledAlarmTimer.run(PooledAlarmTimer.java:99)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)


DBCC command
------------
dbcc complete_xact(xactname, 'rollback')
Raghavender Rao T Send private email
Thursday, June 16, 2011
 
 
any solution to the issue i am facing above?
Raghavender Rao T Send private email
Monday, June 20, 2011
 
 
The datasource or connectionfactory has not been added to the configuration yet when this happens?
Guy Pardon Send private email
Monday, June 20, 2011
 
 
<bean id="atomikosDataSource" class="com.atomikos.jdbc.AtomikosDataSourceBean" destroy-method="close">
          <property name="xaDataSourceClassName"> <value>com.sybase.jdbc3.jdbc.SybXADataSource</value></property>
          <property name="uniqueResourceName"><value>ase</value></property>
          <property name="xaProperties">
            <props>
              <prop key="serverName">swdogsdb1d.nam.nsroot.net</prop>
              <prop key="portNumber">xx</prop>
              <prop key="databaseName">queuedb</prop>
              <prop key="user">xx</prop>
              <prop key="password">xx</prop>
            </props>
          </property>
          <property name="maxPoolSize"><value>20</value></property>
          <property name="minPoolSize"><value>5</value></property>
          <property name="poolSize"><value>5</value></property>
          <property name="borrowConnectionTimeout" value="10000" />
          <property name="reapTimeout" value="300"/>
          <property name="testQuery" value="select 1" />
    </bean>

    <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
        <property name="driverClass" value="com.sybase.jdbc3.jdbc.SybDriver"/>
        <property name="jdbcUrl" value="jdbc:sybase:Tds:swdogsdb1d.nam.nsroot.net:xx/xx"/>
        <property name="user" value="xx"/>
        <property name="password" value="xx" />
        <property name="initialPoolSize" value="1"/>
        <property name="minPoolSize" value="1"/>
        <property name="maxPoolSize" value="2"/>
    </bean>

    <bean id="jmsConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
        <property name="jndiTemplate" ref="jndiTemplate"/>
        <property name="jndiName" value="xx.xx.ConnectionFactory"/>
    </bean>

I am using the above context in my application. I have configured both atomikos datasource and connection factory.
Raghavender Rao T Send private email
Tuesday, June 21, 2011
 
 
Hello Guy,

Any idea on the issue I am facing?

Raghu
Raghavender Rao T Send private email
Wednesday, June 22, 2011
 
 
Just specify the init-method for each connector...
Guy Pardon Send private email
Friday, June 24, 2011
 
 
Guy,

Do you know how we can clear off the hanging xa transaction in database using atomikos instead of runnin the dbcc comand to clear of the hanging xa transaction. I tried with the init method but the xa transaction still blocks the database when the application is abruptly stopped in the middle of the xa transaction.

Is there any configuration than can be made to clear off the xa transaction which got created when the application was stopped.

Here is my jta.properties

com.atomikos.icatch.service=com.atomikos.icatch.standalone.UserTransactionServiceFactory
com.atomikos.icatch.console_file_name = tm.out
com.atomikos.icatch.log_base_name = tmlog
com.atomikos.icatch.tm_unique_name = com.atomikos.spring.jdbc.tm
com.atomikos.icatch.console_log_level = INFO
com.atomikos.icatch.default_jta_timeout = 10000000
com.atomikos.icatch.enable_logging = true
com.atomikos.icatch.serial_jta_transactions = false
com.atomikos.icatch.max_timeout = 30000000
com.atomikos.level = INFO

Raghu
Raghavender Rao T Send private email
Tuesday, June 28, 2011
 
 
You can make xa transactions be 'forgotten' in the JMX console: http://www.atomikos.com/Documentation/JmxInstrumentation

Note: the TM and the DBMS must be running for this to work.
Guy Pardon Send private email
Monday, July 25, 2011
 
 

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

Other recent topics Other recent topics