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

With client PooledConnection.getConnection() does not reset holdability and isolation state properly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 10.1.3.1
    • 10.1.3.1, 10.2.1.6
    • Network Client
    • None

    Description

      I found this issue when working on DERBY-1044 which was filed for the isolation not getting reset for XAConnections.
      I found that this was a generic issue for PooledConnections and also that holdability was also wrong.

      The fix proposed for DERBY-1044 should also fix this issue. That bug has the repro for the isolation state issue

      For holdability, this code passes for embedded but fails for client:

      // Test holdability
      ConnectionPoolDataSource ds = TestUtil.getConnectionPoolDataSource(p);
      pc1 = ds.getPooledConnection();
      testPooledConnHoldability("PooledConnection", pc1);
      pc1.close();

      **

      • @param string
      • @param pc1
        */
        private static void testPooledConnHoldability(String string, PooledConnection pc1)
        throws SQLException
        Unknown macro: { System.out.println("n**Test holdability state**"); Connection conn = pc1.getConnection(); conn.setHoldability(ResultSet.CLOSE_CURSORS_AT_COMMIT); // reset the connection and see if the holdability gets reset conn = pc1.getConnection(); int holdability = conn.getHoldability(); if (holdability != ResultSet.HOLD_CURSORS_OVER_COMMIT) { System.out.println("FAIL: Holdability not reset on get Connection"); } else { System.out.println("PASS: Holdability reset on getConnection"); } conn.close(); }

      Attachments

        1. derby1144.diff
          14 kB
          Katherine Marsden

        Issue Links

          Activity

            People

              kmarsden Katherine Marsden
              kmarsden Katherine Marsden
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: