Announcement Announcement Module
No announcement yet.
Distributed Transaction (XA) Using Atomikos Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Distributed Transaction (XA) Using Atomikos


    I am trying to write simple service which will

    1. Insert Record into MySQL Database. (mysqlTestDatasource)
    2. Select records inserted into mysql database. (mysqlTestDatasource)
    3. Insert records into oracle database which were selected from MySQL (oracleTestDatasource)
    4. Update COPY_FLAG in mysql database. (mysqlTestDatasource)


    I am throwing RuntimeException explicitly at Step#4. As per distributed transaction management Step#1 should also rollback and there should not be any data in Mysql database.

    But it is getting committed. Please let me know what is wrong with attached source.

    I am not clear about the transaction management concept with Spring too.
    Attached Files

  • #2
    Not sure which forum this thread belongs in, but I'll answer it as XA is relevant in Spring Integration, particularly when crossing
    Database sovereignties or JMS.

    In general, I'd advise you to start with the Spring example code at Atomikos provides for Transaction Essentials and get
    that working first on your specific database environment to shakedown any configuration or driver issues.

    The XA Environment is very sensitive to Vendor JDBC Driver selection and configuration. When I hear of SQL statements getting committed on one database but not the other, I always suspect it's because someone is:
    * not using an XADataSource driver at all
    * the driver's properties aren't being setup right
    * or that the SQL engine has not been propertly configured for XA connections


    • #3
      Issue is resolved. Need to use either Transaction Proxy Bean Factory or @Transactional annotation.

      I was using the @Transactional attribute but not used tx:annotation-driven.


      • #4
        Please don't revive old threads with new questions. And please don't post the same question repeatedly.