Results 1 to 4 of 4

Thread: Distributed Transaction (XA) Using Atomikos

  1. #1
    Join Date
    Sep 2012
    Location
    Pune
    Posts
    4

    Default Distributed Transaction (XA) Using Atomikos

    Hi,

    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)

    applicationContext.xml.txt
    Department.java.txt
    DepartmentDAO.java.txt
    DepartmentDAOImpl.java.txt
    SimpleService.java.txt

    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.

  2. #2
    Join Date
    Sep 2012
    Location
    Medford, MA
    Posts
    11

    Default

    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. #3
    Join Date
    Sep 2012
    Location
    Pune
    Posts
    4

    Default

    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. #4
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,016

    Default

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

    http://forum.springsource.org/showth...995#post439995
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

Posting Permissions

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