Derby
  1. Derby
  2. DERBY-5096

DisconnectException: "Connection was refused because the database DB was not found" when creating db for first time

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 10.7.1.1
    • Component/s: Network Server
    • Labels:
      None
    • Environment:
      System: OS/400 V7R1M0 on PowerPC; JVM: IBM J9 VM 2.4 (consistently reproducible).
      But also: Windows 2008 R2 on VMWare and Windows 7 64 bit with Sun VM (1.6) too (but not as consistently reproducible)
    • Issue & fix info:
      Patch Available
    • Bug behavior facts:
      Seen in production

      Description

      A process starts derby as network server (new NetworkServerControl, start) and waits for derby to respond (retry ping until success). After the server has started, the same process makes a connection with DriverManager.getConnection().

      The first time this process runs, this will always fail with "SQLNonTransientConnectionException: The connection was refused because the database Flows;create=true was not found." However, at the same time, "derby.log" and "Flows" directory are created in the derby home. The "Flows" directory contains "log", "seg0", "tmp", "db.lck", "service.properties", etc ...

      The second time the process is started, the connection will succeed and the "Flows" database can be used successfully. From now on, every start will be successful. After cleaning the derby home directory, you get the exception again after the first start.

      The attachment contains a Java program (DerbyGetConnection.java) that reproduces this problem consistently on our OS/400 V7R1M0 with IBM J9 VM. Probably this may happen on other systems too (Win7), but we were unable to reproduce it there (on my machine with Win7, this same program ran successful every run; might be a threading or I/O issue that occurs easily on slower hardware?).
      The attachment contains also derby tracing ("derby.drda.traceAll") and logging/tracing of the DriverManager.

      1. derby-5096_uncondset_diff.txt
        2 kB
        Kathey Marsden
      2. derby-5096_diff.txt
        4 kB
        Kathey Marsden
      3. TestLowerCaseTraversal.java
        2 kB
        Kathey Marsden
      4. getconnection_reproduce.zip
        7 kB
        Steven Hendrickx

        Issue Links

          Activity

          Knut Anders Hatlen made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Gavin made changes -
          Workflow jira [ 12600916 ] Default workflow, editable Closed status [ 12802143 ]
          Kathey Marsden made changes -
          Fix Version/s 10.8.3.0 [ 12323456 ]
          Fix Version/s 10.8.2.3 [ 12318540 ]
          Kathey Marsden made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Fix Version/s 10.6.2.3 [ 12315434 ]
          Resolution Fixed [ 1 ]
          Kathey Marsden made changes -
          Fix Version/s 10.5.3.2 [ 12315436 ]
          Fix Version/s 10.7.1.4 [ 12315902 ]
          Fix Version/s 10.8.2.3 [ 12318540 ]
          Fix Version/s 10.9.0.0 [ 12316344 ]
          Kathey Marsden made changes -
          Issue & fix info Patch Available [ 10102 ]
          Kathey Marsden made changes -
          Attachment derby-5096_uncondset_diff.txt [ 12505650 ]
          Kathey Marsden made changes -
          Attachment derby-5096_diff.txt [ 12504925 ]
          Kathey Marsden made changes -
          Resolution Invalid [ 6 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          Assignee Kathey Marsden [ kmarsden ]
          Myrna van Lunteren made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Invalid [ 6 ]
          Kathey Marsden made changes -
          Link This issue is related to DERBY-4149 [ DERBY-4149 ]
          Kathey Marsden made changes -
          Attachment TestLowerCaseTraversal.java [ 12473218 ]
          Steven Hendrickx made changes -
          Summary DisconnectException: "Connection was refused because the database DB was not found" on OS/400 DisconnectException: "Connection was refused because the database DB was not found" when creating db for first time
          Environment System: OS/400 V7R1M0 on PowerPC; JVM: IBM J9 VM 2.4 (continuously reproducible).
          Probably Windows 7 64 bit with Sun VM (1.6) too (but not reproduced)
          System: OS/400 V7R1M0 on PowerPC; JVM: IBM J9 VM 2.4 (consistently reproducible).
          But also: Windows 2008 R2 on VMWare and Windows 7 64 bit with Sun VM (1.6) too (but not as consistently reproducible)
          Steven Hendrickx made changes -
          Description A process starts derby as network server (new NetworkServerControl, start) and waits for derby to respond (retry ping until success). After the server has started, the same process makes a connection with DriverManager.getConnection().

          The first time this process runs, this will always fail with "SQLNonTransientConnectionException: The connection was refused because the database Flows;create=true was not found." However, at the same time, "derby.log" and "Flows" directory are created in the derby home. The "Flows" directory contains "log", "seg0", "tmp", "db.lck", "service.properties", etc ...

          The second time the process is started, the connection will succeed and the "Flows" database can be used successfully.

          The attachment contains a Java program (DerbyGetConnection.java) that reproduces this problem consistently on our OS/400 V7R1M0 with IBM J9 VM. Probably this may happen on other systems too (Win7), but we were unable to reproduce it there (on my machine with Win7, this same program ran successful every run; might be a threading or I/O issue that occurs easily on slower hardware?).
          The attachment contains also derby tracing ("derby.drda.traceAll") and logging/tracing of the DriverManager.
          A process starts derby as network server (new NetworkServerControl, start) and waits for derby to respond (retry ping until success). After the server has started, the same process makes a connection with DriverManager.getConnection().

          The first time this process runs, this will always fail with "SQLNonTransientConnectionException: The connection was refused because the database Flows;create=true was not found." However, at the same time, "derby.log" and "Flows" directory are created in the derby home. The "Flows" directory contains "log", "seg0", "tmp", "db.lck", "service.properties", etc ...

          The second time the process is started, the connection will succeed and the "Flows" database can be used successfully. From now on, every start will be successful. After cleaning the derby home directory, you get the exception again after the first start.

          The attachment contains a Java program (DerbyGetConnection.java) that reproduces this problem consistently on our OS/400 V7R1M0 with IBM J9 VM. Probably this may happen on other systems too (Win7), but we were unable to reproduce it there (on my machine with Win7, this same program ran successful every run; might be a threading or I/O issue that occurs easily on slower hardware?).
          The attachment contains also derby tracing ("derby.drda.traceAll") and logging/tracing of the DriverManager.
          Steven Hendrickx made changes -
          Field Original Value New Value
          Attachment getconnection_reproduce.zip [ 12472822 ]
          Steven Hendrickx created issue -

            People

            • Assignee:
              Kathey Marsden
              Reporter:
              Steven Hendrickx
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development