Derby
  1. Derby
  2. DERBY-1236

Verify that applications can't manipulate the transaction state while inside a distributed transaction.

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 10.1.2.1
    • Fix Version/s: 10.2.1.6
    • Component/s: JDBC
    • Labels:
      None

      Description

      The next rev of the JDBC4 spec will clarify that applications may not call the following methods while inside distributed transactions: setAutoCommit( true ), commit(), rollback(), and setSavepoint(). We should verify that we conform.

      1. derby-1236.v1.diff
        1 kB
        Dyre Tjeldvoll
      2. derby-1236.v1.stat
        0.5 kB
        Dyre Tjeldvoll

        Issue Links

          Activity

          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open In Progress In Progress
          4d 18h 2m 1 Dyre Tjeldvoll 25/Apr/06 19:16
          In Progress In Progress Resolved Resolved
          2h 55m 1 Dyre Tjeldvoll 25/Apr/06 22:12
          Resolved Resolved Closed Closed
          1d 18h 41m 1 Dyre Tjeldvoll 27/Apr/06 16:53
          Gavin made changes -
          Workflow jira [ 12361346 ] Default workflow, editable Closed status [ 12797901 ]
          Rick Hillegas made changes -
          Link This issue is related to DERBY-4552 [ DERBY-4552 ]
          Dyre Tjeldvoll made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Dyre Tjeldvoll made changes -
          Resolution Fixed [ 1 ]
          Status In Progress [ 3 ] Resolved [ 5 ]
          Derby Info [Patch Available]
          Hide
          Rick Hillegas added a comment -

          Committed at subversion revision 396889.

          Show
          Rick Hillegas added a comment - Committed at subversion revision 396889.
          Hide
          Rick Hillegas added a comment -

          Thanks, Dyre. I'll take a look at this patch.

          Show
          Rick Hillegas added a comment - Thanks, Dyre. I'll take a look at this patch.
          Dyre Tjeldvoll made changes -
          Derby Info [Patch Available]
          Dyre Tjeldvoll made changes -
          Attachment derby-1236.v1.diff [ 12325818 ]
          Attachment derby-1236.v1.stat [ 12325819 ]
          Hide
          Dyre Tjeldvoll added a comment -

          Attiching patch (v1) that adds (negative) testcases for setSavePoint() inside a global transaction.
          I have not run derbyall, but I have run XATest.java with java 1.4, 1.5, and 1.6 in embedded and DerbyNetClient. The test appears to be disabled in 1.3 and fails on trunk in DerbyNet.

          Please review

          Show
          Dyre Tjeldvoll added a comment - Attiching patch (v1) that adds (negative) testcases for setSavePoint() inside a global transaction. I have not run derbyall, but I have run XATest.java with java 1.4, 1.5, and 1.6 in embedded and DerbyNetClient. The test appears to be disabled in 1.3 and fails on trunk in DerbyNet. Please review
          Dyre Tjeldvoll made changes -
          Fix Version/s 10.2.0.0 [ 11187 ]
          Affects Version/s 10.1.2.0 [ 12310270 ]
          Component/s JDBC [ 11407 ]
          Hide
          Dyre Tjeldvoll added a comment -

          setAutoCommit(), commit() and rollback() inside a global transaction is tested in jdbcapi/XATest.java (and others).

          setSavepoint() and setSavepoint(String) are NOT tested, but I have verfied that they throw an exception in a global transaction.

          The exceptions thrown are (note that the setSavepoint methods uses the same Exception/error message as rollback):

          commit():
          SQL Exception: Cannot commit a global transaction using the Connection, commit p
          rocessing must go thru XAResource interface.

          rollback():
          SQL Exception: Cannot rollback a global transaction using the Connection, commit
          processing must go thru XAResource interface.

          setAutoCommit(true):
          SQL Exception: Cannot set AUTOCOMMIT ON when in an XA connection.

          setSavepoint():
          SQL Exception: Cannot rollback a global transaction using the Connection, commit
          processing must go thru XAResource interface.

          setSavepoint(String):
          SQL Exception: Cannot rollback a global transaction using the Connection, commit
          processing must go thru XAResource interface.

          I plan to add setSavepoint() and setSavepoint(String) as test cases in XATest.java.

          Show
          Dyre Tjeldvoll added a comment - setAutoCommit(), commit() and rollback() inside a global transaction is tested in jdbcapi/XATest.java (and others). setSavepoint() and setSavepoint(String) are NOT tested, but I have verfied that they throw an exception in a global transaction. The exceptions thrown are (note that the setSavepoint methods uses the same Exception/error message as rollback): commit(): SQL Exception: Cannot commit a global transaction using the Connection, commit p rocessing must go thru XAResource interface. rollback(): SQL Exception: Cannot rollback a global transaction using the Connection, commit processing must go thru XAResource interface. setAutoCommit(true): SQL Exception: Cannot set AUTOCOMMIT ON when in an XA connection. setSavepoint(): SQL Exception: Cannot rollback a global transaction using the Connection, commit processing must go thru XAResource interface. setSavepoint(String): SQL Exception: Cannot rollback a global transaction using the Connection, commit processing must go thru XAResource interface. I plan to add setSavepoint() and setSavepoint(String) as test cases in XATest.java.
          Dyre Tjeldvoll made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Dyre Tjeldvoll made changes -
          Field Original Value New Value
          Assignee Dyre Tjeldvoll [ dyret ]
          Rick Hillegas created issue -

            People

            • Assignee:
              Dyre Tjeldvoll
              Reporter:
              Rick Hillegas
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development