Derby
  1. Derby
  2. DERBY-639

Statements in stored procedures with holdable cursor should not be allowed to execute in xa global transaction

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 10.2.1.6
    • Fix Version/s: None
    • Component/s: JDBC
    • Urgency:
      Normal
    • Bug behavior facts:
      Deviation from standard

      Description

      Execution of statements with HOLD_CURSORS_OVER_COMMIT must not be allowed in a global transaction. Currently, this is allowed when the statement is inside a stored procedure.

      e.g: The following procedure should throw an error when executed inside a global transaction. However, no error is thrown when running with embedded or client drivers.

      //Java method for stored procedure with HOLD_CURSORS_OVER_COMMIT
      public static void testHoldCursorsProc(ResultSet[] rs) throws Exception

      { Connection conn = DriverManager.getConnection("jdbc:default:connection"); //HOLD_CURSORS_OVER_COMMIT Statement st = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE , ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT); rs[0] = st.executeQuery("select * from testtable1"); }
      1. d639.sql
        1 kB
        Deepa Remesh
      2. d639.java
        0.5 kB
        Deepa Remesh

        Issue Links

          Activity

          Hide
          Mike Matrigali added a comment -

          Triaged July 2, 2009: Marked as non standard and assigned normal urgency.

          Show
          Mike Matrigali added a comment - Triaged July 2, 2009: Marked as non standard and assigned normal urgency.
          Hide
          Daniel John Debrunner added a comment -

          JDBC 4.0 (proposed final draft) section 16.1.3.1 allows the returned ResultSet from a driver to have a different
          holability to that of its Statement.

          "It is the application's responsibility, not the JDBC driver implementation, to validate
          the holdability of the returned ResultSet. An application can find out the
          holdability of a ResultSet object by calling the method
          ResultSet.getHoldability."

          Thus the procedure execution should succeed but it should be returning non-holdable ResultSets.

          Show
          Daniel John Debrunner added a comment - JDBC 4.0 (proposed final draft) section 16.1.3.1 allows the returned ResultSet from a driver to have a different holability to that of its Statement. "It is the application's responsibility, not the JDBC driver implementation, to validate the holdability of the returned ResultSet. An application can find out the holdability of a ResultSet object by calling the method ResultSet.getHoldability." Thus the procedure execution should succeed but it should be returning non-holdable ResultSets.
          Hide
          Deepa Remesh added a comment -

          Attaching a repro for this. To see the problem, run d639.sql using ij. The stored procedure used in the sql is in d639.java.

          Currently, the sql runs successfully and the behaviour is same in local and global transaction. This does not seem right. It should give an error when executing this procedure in a global transaction.

          Show
          Deepa Remesh added a comment - Attaching a repro for this. To see the problem, run d639.sql using ij. The stored procedure used in the sql is in d639.java. Currently, the sql runs successfully and the behaviour is same in local and global transaction. This does not seem right. It should give an error when executing this procedure in a global transaction.

            People

            • Assignee:
              Unassigned
              Reporter:
              Deepa Remesh
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:

                Development