Derby
  1. Derby
  2. DERBY-3237

3 JDBC4.0 apis on Connection object behave differently in Network Server and Embedded mode after Derby is shutdown

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 10.3.1.4, 10.4.1.3
    • Fix Version/s: None
    • Component/s: JDBC
    • Urgency:
      Low
    • Bug behavior facts:
      Embedded/Client difference

      Description

      While working on DERBY-3172, I found that following 3 JDBC4.0 apis, isValid, isWrapperFor and unwrap on Connection object behave differently in Network Server and Embedded mode after Network Server/Embedded Derby is shutdown. I have attached a reproducible case to show the behavior difference but here is brief description of the problem.

      In JDBC4, two methods isWrapperFor and unwrap on Connection object do not go to the server when Derby is being accessed in client server mode and because of this, we never detect that the server is down and hence no connection error event or connection closed exception is thrown in client server mode for these 2 apis. But when the same apis are called in embedded Derby after the engine is shutdown, we get connection error event and connection closed exception.

      And lastly, the new JDBC4 api isValid on Connection object has different behavior in client server mode and embedded mode. Embedded throws exception that the connection is down but Network Server incorrectly returns true from isValid even when the Network Server has been shutdown. In addition, in embedded mode, after the engine is shutdown, an isValid call on Connection object raises a connection closed event. In client server mode, after the Network Server is shutdown, an isValid call on Connection object does not raise any event. Again, I am not sure if this is expected bahavior difference between the 2 configurations of Derby. Lastly, as per Connection.isValid api Java specification, a SQLException is thrown under following condition which is not being followed in embedded
      Throws:
      SQLException - if the value supplied for timeout is less then 0
      Based on this, I am not sure if our behavior is correct to throw an SQLException if the engine is down.

        Issue Links

          Activity

          Gavin made changes -
          Workflow jira [ 12418194 ] Default workflow, editable Closed status [ 12799493 ]
          Kathey Marsden made changes -
          Labels derby_triage10_5_2
          Kathey Marsden made changes -
          Link This issue relates to DERBY-4165 [ DERBY-4165 ]
          Kathey Marsden made changes -
          Bug behavior facts [Embedded/Client difference]
          Urgency Low
          Priority Major [ 3 ] Minor [ 4 ]
          Mamta A. Satoor made changes -
          Field Original Value New Value
          Attachment DERBY_3172_Repro.java [ 12370561 ]
          Mamta A. Satoor created issue -

            People

            • Assignee:
              Unassigned
              Reporter:
              Mamta A. Satoor
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:

                Development