Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-2360

The XAResource.end(xid, XAResource.TMFAIL) throws an exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 10.3.1.4
    • None
    • JDBC
    • None
    • Solaris Nevada build 56, sun jdk 1.6
    • Urgent

    Description

      If I execute this peace of code

      Xid xid = createXid(9,11);
      xaRes.start(xid, XAResource.TMNOFLAGS);
      Statement stm = conn.createStatement();
      stm.execute("create table NumberTable2 (i int)");
      stm.execute("insert into NumberTable2 values (1)");
      xaRes.end(xid, XAResource.TMFAIL);
      xaRes.rollback(xid);

      I get the following exception

      1) testXAConnection(org.apache.derbyTesting.functionTests.tests.jdbcapi.XATransactionTest)javax.transaction.xa.XAException
      at org.apache.derby.jdbc.EmbedXAResource.end(EmbedXAResource.java:208)
      at org.apache.derbyTesting.functionTests.tests.jdbcapi.XATransactionTest.testXAConnection(XATransactionTest.java:94)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:76)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
      at junit.extensions.TestSetup.run(TestSetup.java:25)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
      at junit.extensions.TestSetup.run(TestSetup.java:25)

      If I change TMFAIL to TMSUCCESS, everything works. The end with TMFAIL shoudl do the same as with TMSUCCESS except that I can only rollback the transaction.

      Attachments

        Activity

          People

            julo Julius Stroffek
            julo Julius Stroffek
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: