Derby
  1. Derby
  2. DERBY-5085

After specifying deregister=false on the engine shutdown URL, Derby forgets that the default behavior is deregister=true

    Details

    • Urgency:
      Blocker
    • Issue & fix info:
      Patch Available, Repro attached

      Description

      If you shutdown the engine specifying deregister=false, then get a new connection, then shutdown the engine again without specifying any value for the deregister attribute, Derby acts as though you specified deregister=false again. I will attach a test program which shows this problem.

      1. DERBY-5085_1.diff
        0.6 kB
        Lily Wei
      2. y.java
        2 kB
        Rick Hillegas

        Issue Links

          Activity

          Hide
          Rick Hillegas added a comment -

          Attaching y.java, a repro for this problem. Here is the output from this program:

          java y true
          Connection is a org.apache.derby.impl.jdbc.EmbedConnection40
          Saw SQLState XJ015 after trying to shutdown with this url: jdbc:derby:;shutdown=true;deregister=false
          Connection is a org.apache.derby.impl.jdbc.EmbedConnection40
          Saw SQLState XJ015 after trying to shutdown with this url: jdbc:derby:;shutdown=true;deregister=true
          As expected, could not get a connection after an ordinary orderly shutdown.
          Connection is a org.apache.derby.impl.jdbc.EmbedConnection40
          Success!

          java y false
          Connection is a org.apache.derby.impl.jdbc.EmbedConnection40
          Saw SQLState XJ015 after trying to shutdown with this url: jdbc:derby:;shutdown=true;deregister=false
          Connection is a org.apache.derby.impl.jdbc.EmbedConnection40
          Saw SQLState XJ015 after trying to shutdown with this url: jdbc:derby:;shutdown=true
          Connection is a org.apache.derby.impl.jdbc.EmbedConnection40
          Oops! Did not expect to be able to get a connection!

          The above tests were run on Java 6. Note that you can also run this test on JDK 1.4 and see the same behavior there:

          java -Djdbc.drivers=org.apache.derby.jdbc.EmbeddedDriver y true
          Connection is a org.apache.derby.impl.jdbc.EmbedConnection30
          Saw SQLState XJ015 after trying to shutdown with this url: jdbc:derby:;shutdown=true;deregister=false
          Connection is a org.apache.derby.impl.jdbc.EmbedConnection30
          Saw SQLState XJ015 after trying to shutdown with this url: jdbc:derby:;shutdown=true;deregister=true
          As expected, could not get a connection after an ordinary orderly shutdown.
          Connection is a org.apache.derby.impl.jdbc.EmbedConnection30
          Success!

          java -Djdbc.drivers=org.apache.derby.jdbc.EmbeddedDriver y false
          Connection is a org.apache.derby.impl.jdbc.EmbedConnection30
          Saw SQLState XJ015 after trying to shutdown with this url: jdbc:derby:;shutdown=true;deregister=false
          Connection is a org.apache.derby.impl.jdbc.EmbedConnection30
          Saw SQLState XJ015 after trying to shutdown with this url: jdbc:derby:;shutdown=true
          Connection is a org.apache.derby.impl.jdbc.EmbedConnection30
          Oops! Did not expect to be able to get a connection!

          Show
          Rick Hillegas added a comment - Attaching y.java, a repro for this problem. Here is the output from this program: java y true Connection is a org.apache.derby.impl.jdbc.EmbedConnection40 Saw SQLState XJ015 after trying to shutdown with this url: jdbc:derby:;shutdown=true;deregister=false Connection is a org.apache.derby.impl.jdbc.EmbedConnection40 Saw SQLState XJ015 after trying to shutdown with this url: jdbc:derby:;shutdown=true;deregister=true As expected, could not get a connection after an ordinary orderly shutdown. Connection is a org.apache.derby.impl.jdbc.EmbedConnection40 Success! java y false Connection is a org.apache.derby.impl.jdbc.EmbedConnection40 Saw SQLState XJ015 after trying to shutdown with this url: jdbc:derby:;shutdown=true;deregister=false Connection is a org.apache.derby.impl.jdbc.EmbedConnection40 Saw SQLState XJ015 after trying to shutdown with this url: jdbc:derby:;shutdown=true Connection is a org.apache.derby.impl.jdbc.EmbedConnection40 Oops! Did not expect to be able to get a connection! The above tests were run on Java 6. Note that you can also run this test on JDK 1.4 and see the same behavior there: java -Djdbc.drivers=org.apache.derby.jdbc.EmbeddedDriver y true Connection is a org.apache.derby.impl.jdbc.EmbedConnection30 Saw SQLState XJ015 after trying to shutdown with this url: jdbc:derby:;shutdown=true;deregister=false Connection is a org.apache.derby.impl.jdbc.EmbedConnection30 Saw SQLState XJ015 after trying to shutdown with this url: jdbc:derby:;shutdown=true;deregister=true As expected, could not get a connection after an ordinary orderly shutdown. Connection is a org.apache.derby.impl.jdbc.EmbedConnection30 Success! java -Djdbc.drivers=org.apache.derby.jdbc.EmbeddedDriver y false Connection is a org.apache.derby.impl.jdbc.EmbedConnection30 Saw SQLState XJ015 after trying to shutdown with this url: jdbc:derby:;shutdown=true;deregister=false Connection is a org.apache.derby.impl.jdbc.EmbedConnection30 Saw SQLState XJ015 after trying to shutdown with this url: jdbc:derby:;shutdown=true Connection is a org.apache.derby.impl.jdbc.EmbedConnection30 Oops! Did not expect to be able to get a connection!
          Hide
          Lily Wei added a comment -

          Thanks, Rick. Upload patch DERBY-5085_1.diff. With this patch, derby will keep the default behavior deregister=true after shutdown derby with deregister=false.

          Show
          Lily Wei added a comment - Thanks, Rick. Upload patch DERBY-5085 _1.diff. With this patch, derby will keep the default behavior deregister=true after shutdown derby with deregister=false.
          Hide
          Rick Hillegas added a comment -

          Thanks, Lily. I can confirm that after applying this patch, the repro behaves correctly. Thanks.

          Show
          Rick Hillegas added a comment - Thanks, Lily. I can confirm that after applying this patch, the repro behaves correctly. Thanks.
          Hide
          Lily Wei added a comment -

          Thanks Rick. It passed AutoloadTest and my other DERBY-2905 tests as well. I am running regression tests now. Once there is no issue on the regression test suites. I will commit the fix.

          Show
          Lily Wei added a comment - Thanks Rick. It passed AutoloadTest and my other DERBY-2905 tests as well. I am running regression tests now. Once there is no issue on the regression test suites. I will commit the fix.
          Hide
          Lily Wei added a comment -

          Suites.all and derbyall run clean with the patch. I've committed with revision 1076499. Thanks Rick.

          Show
          Lily Wei added a comment - Suites.all and derbyall run clean with the patch. I've committed with revision 1076499. Thanks Rick.

            People

            • Assignee:
              Lily Wei
              Reporter:
              Rick Hillegas
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development