Results 1 to 3 of 3

Thread: Atomikos Spring Nested Transaction

  1. #1
    Join Date
    Jun 2009
    Posts
    1

    Default Atomikos Spring Nested Transaction

    I have been attempting to use Atomikos for JTA XA transactions with Spring and came across a bit on their website that says:

    We support most of the Spring demarcation attributes except PROPAGATION_NESTED since that one depends on the Spring DataSourceTransactionManager strategy (incompatible with JTA/XA).

    http://www.atomikos.com/Documentation/SpringIntegration

    So, from what I understand from that, I am going to be unable to use Atomikos if I want to use nested transactions? I actually tried giving it a whirl anyway and I can see that a nested transaction is created, them commited, and the parent transaction is rollback (this is one I want), however, it appears that the data created in the database during the nested transaction is also rolled back.

    So, the question is, have I simply made a mistake in my logic? Or have I got the right end of the stick? Do you know if JOTM supports nested transactions?

    Any help you can provide would be much appreciated.

    Here is an extract from the Atomikos logs:

    Code:
    INFO  atomikos - createCompositeTransaction ( 600000 ): created new ROOT transaction with id 158.234.17.123.tm0000100106
    INFO  atomikos - addParticipant ( XAResourceTransaction: 3135382E3233342E31372E3132332E746D30303030313030313036:3135382E3233342E31372E3132332E746D31 ) for transaction 158.234.17.123.tm0000100106
    INFO  atomikos - XAResource.start ( 3135382E3233342E31372E3132332E746D30303030313030313036:3135382E3233342E31372E3132332E746D31 , XAResource.TMNOFLAGS ) on resource XADBMS represented by XAResource instance oracle.jdbc.driver.T4CXAResource@1daebe8
    INFO  atomikos - XAResource.end ( 3135382E3233342E31372E3132332E746D30303030313030313036:3135382E3233342E31372E3132332E746D31 , XAResource.TMSUCCESS ) on resource XADBMS represented by XAResource instance oracle.jdbc.driver.T4CXAResource@1daebe8
    INFO  atomikos - addParticipant ( XAResourceTransaction: 3135382E3233342E31372E3132332E746D30303030313030313036:3135382E3233342E31372E3132332E746D31 ) for transaction 158.234.17.123.tm0000100106
    INFO  atomikos - XAResource.start ( 3135382E3233342E31372E3132332E746D30303030313030313036:3135382E3233342E31372E3132332E746D31 , XAResource.TMJOIN ) on resource XADBMS represented by XAResource instance oracle.jdbc.driver.T4CXAResource@32dada
    INFO  atomikos - XAResource.end ( 3135382E3233342E31372E3132332E746D30303030313030313036:3135382E3233342E31372E3132332E746D31 , XAResource.TMSUCCESS ) on resource XADBMS represented by XAResource instance oracle.jdbc.driver.T4CXAResource@32dada
    INFO  atomikos - XAResource.end ( 3135382E3233342E31372E3132332E746D30303030313030313036:3135382E3233342E31372E3132332E746D32 , XAResource.TMSUCCESS ) on resource My_MQSeries_XA_RMI represented by XAResource instance com.ibm.mq.MQXAResource@1e558da
    INFO  atomikos - createCompositeTransaction ( 600000 )
    INFO  atomikos - createSubTransaction(): created new SUBTRANSACTION 158.234.17.123.tm0000200106 for existing transaction 158.234.17.123.tm0000100106
    WARN  atomikos - JDBC ConnectionPool exhausted - allocated new connection: ExternalXAPooledConnectionImp1246384453998com.atomikos.jdbc.ExclusiveExternalXAPooledConnectionImp@18ebcc
    INFO  atomikos - addParticipant ( XAResourceTransaction: 3135382E3233342E31372E3132332E746D30303030323030313036:3135382E3233342E31372E3132332E746D33 ) for transaction 158.234.17.123.tm0000200106
    INFO  atomikos - XAResource.start ( 3135382E3233342E31372E3132332E746D30303030323030313036:3135382E3233342E31372E3132332E746D33 , XAResource.TMNOFLAGS ) on resource XADBMS represented by XAResource instance oracle.jdbc.driver.T4CXAResource@20cf5e
    INFO  atomikos - XAResource.end ( 3135382E3233342E31372E3132332E746D30303030323030313036:3135382E3233342E31372E3132332E746D33 , XAResource.TMSUCCESS ) on resource XADBMS represented by XAResource instance oracle.jdbc.driver.T4CXAResource@20cf5e
    WARN  atomikos - JDBC ConnectionPool exhausted - allocated new connection: ExternalXAPooledConnectionImp1246384455123com.atomikos.jdbc.ExclusiveExternalXAPooledConnectionImp@1087cdc
    INFO  atomikos - addParticipant ( XAResourceTransaction: 3135382E3233342E31372E3132332E746D30303030323030313036:3135382E3233342E31372E3132332E746D33 ) for transaction 158.234.17.123.tm0000200106
    INFO  atomikos - XAResource.start ( 3135382E3233342E31372E3132332E746D30303030323030313036:3135382E3233342E31372E3132332E746D33 , XAResource.TMJOIN ) on resource XADBMS represented by XAResource instance oracle.jdbc.driver.T4CXAResource@3d780d
    INFO  atomikos - XAResource.end ( 3135382E3233342E31372E3132332E746D30303030323030313036:3135382E3233342E31372E3132332E746D33 , XAResource.TMSUCCESS ) on resource XADBMS represented by XAResource instance oracle.jdbc.driver.T4CXAResource@3d780d
    WARN  atomikos - JDBC ConnectionPool exhausted - allocated new connection: ExternalXAPooledConnectionImp1246384455185com.atomikos.jdbc.ExclusiveExternalXAPooledConnectionImp@1043f55
    INFO  atomikos - addParticipant ( XAResourceTransaction: 3135382E3233342E31372E3132332E746D30303030323030313036:3135382E3233342E31372E3132332E746D33 ) for transaction 158.234.17.123.tm0000200106
    INFO  atomikos - XAResource.start ( 3135382E3233342E31372E3132332E746D30303030323030313036:3135382E3233342E31372E3132332E746D33 , XAResource.TMJOIN ) on resource XADBMS represented by XAResource instance oracle.jdbc.driver.T4CXAResource@1d9e90c
    INFO  atomikos - XAResource.end ( 3135382E3233342E31372E3132332E746D30303030323030313036:3135382E3233342E31372E3132332E746D33 , XAResource.TMSUCCESS ) on resource XADBMS represented by XAResource instance oracle.jdbc.driver.T4CXAResource@1d9e90c
    INFO  atomikos - commit() done (by application) of transaction 158.234.17.123.tm0000200106
    INFO  atomikos - XAResource.rollback ( 3135382E3233342E31372E3132332E746D30303030313030313036:3135382E3233342E31372E3132332E746D31 ) on resource XADBMS represented by XAResource instance oracle.jdbc.driver.T4CXAResource@6e5558
    INFO  atomikos - XAResource.rollback ( 3135382E3233342E31372E3132332E746D30303030313030313036:3135382E3233342E31372E3132332E746D32 ) on resource My_MQSeries_XA_RMI represented by XAResource instance com.ibm.mq.MQXAResource@1e558da
    INFO  atomikos - XAResource.rollback ( 3135382E3233342E31372E3132332E746D30303030323030313036:3135382E3233342E31372E3132332E746D33 ) on resource XADBMS represented by XAResource instance oracle.jdbc.driver.T4CXAResource@1d9e90c
    INFO  atomikos - afterCompletion ( STATUS_ROLLEDBACK ) called  on Synchronization: org.hibernate.transaction.CacheSynchronization
    INFO  atomikos - rollback() done of transaction 158.234.17.123.tm0000100106
    INFO  atomikos - Closed JMS session

  2. #2

    Default Rollback

    Hi,

    Regardless of whether this is compatible with Spring nested transaction demarcation: nested transactions only really commit if the parent (ROOT in your example) commits. I see no evidence of that happening in your log excerpt, meaning a timeout will rollback the root (and hence also the nested work).

    HTH

  3. #3
    Join Date
    Jun 2009
    Posts
    2

    Default

    If I understand you correctly, what you tring to achieve is a nested XA/2PC transaction. PROPAGATION_NESTED is a invasive spring dependent transaction definition (incompatible with JTA/XA) which requires special design in JTA inplementation and can be used for JDBC resource transaction only, that why most JTA implemention include JOTM doesn't support it. As far as I know, the only TM that support PROPAGATION_NESTED is spring out-of-the-box TM DataSourceTransactionManager. I don't know if there is a existing technoloty/framework that can handle nested XA/2PC transaciton.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •