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

Uncommitted transactions executed throught XAResource will held locks after the application terminates (or crashes during the transaction).

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 10.2.2.0, 10.3.1.4
    • 10.2.2.1, 10.3.1.4
    • JDBC
    • None
    • Solaris Nevada build 49, Sun's JDK1.6
    • Normal

    Description

      Using this piece of code derby will not release a table lock of 'dummy' table.

      String query = "insert into dummy (field1) values ('" + Integer.toString(value) + "')";
      XAConnection xaConnection = createXAConnection("jdbc:derby://localhost:1527/TestDB", "", "");
      XAResource xaResource = xaConnection.getXAResource();
      conn = xaConnection.getConnection();

      Xid xid = createXid(value);

      xaResource.setTransactionTimeout(10);
      xaResource.start(xid, XAResource.TMNOFLAGS);

      Statement statement = conn.createStatement();
      statement.execute(query);

      // terminate the client application
      // this will not release any locks
      System.exit(0);

      Attachments

        1. d2220_beta.diff
          3 kB
          Julius Stroffek
        2. d2220_beta2.diff
          7 kB
          Julius Stroffek
        3. d2220_fix.diff
          0.5 kB
          Julius Stroffek
        4. d2220_fix.stat
          0.2 kB
          Julius Stroffek
        5. d2220_try1.diff
          20 kB
          Julius Stroffek
        6. d2220_try1.stat
          0.6 kB
          Julius Stroffek
        7. d2220_try2.diff
          20 kB
          Julius Stroffek
        8. d2220_try2.stat
          0.6 kB
          Julius Stroffek
        9. d2220_try4.diff
          15 kB
          Julius Stroffek
        10. d2220_try4.stat
          0.7 kB
          Julius Stroffek
        11. d2220_try5.diff
          6 kB
          Julius Stroffek
        12. d2220_try5.stat
          0.3 kB
          Julius Stroffek
        13. XATranTest.java
          4 kB
          Julius Stroffek
        14. xxx.sql
          0.1 kB
          Julius Stroffek

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Issue deployment