1 Reply Latest reply on May 7, 2009 12:54 AM by vickyk

    jboss5.0.1 multiple XA datasources: autocommit?

    javatwo

      We have application working well in JBOSS 4.0.5GA. After moving to jboss 5.0.1GA, we have to use XA datasources. We setup three mysql XA datasources in our application using hiberhate.

      Each datasource has the following:

      <track-connection-by-tx>true</track-connection-by-tx>
      <new-connection-sql>set autocommit=1</new-connection-sql>
      <no-tx-separate-pools>true</no-tx-separate-pools>

      My question is: set automcommit=1, for performing a number of entity updates, are they in one transaction?

      for autocommit, mysql will commit each update immediately.

      If <new-connection-sql>set autocommit=1</new-connection-sql>
      is removed from datasource configuration, we will get the following error:

      MysqlXAException: XAER_OUTSIDE: Some work is done outside global transaction

      Thanks for help.
      Dave


        • 1. Re: jboss5.0.1 multiple XA datasources: autocommit?
          vickyk

           

          "javatwo" wrote:

          My question is: set automcommit=1, for performing a number of entity updates, are they in one transaction?

          for autocommit, mysql will commit each update immediately.

          If <new-connection-sql>set autocommit=1</new-connection-sql>
          is removed from datasource configuration, we will get the following error:

          The xa transaction ignore the autocommit setting on the connection, I did some tests few day back which confirmed the same.

          "javatwo" wrote:

          MysqlXAException: XAER_OUTSIDE: Some work is done outside global transaction


          Can you simulate this error with plain jsp code? I would like to see it at my end.