Derby
  1. Derby
  2. DERBY-2026

Setting a login timeout in client driver can lead to query timeout

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 10.3.1.4
    • Fix Version/s: 10.5.3.1, 10.6.2.1, 10.7.1.1
    • Component/s: JDBC, Network Client
    • Labels:
      None
    • Environment:
      Client driver on most platforms
    • Urgency:
      Normal
    • Issue & fix info:
      Patch Available, Repro attached
    • Bug behavior facts:
      Seen in production

      Description

      Setting the login timeout by using DriverManager.setLoginTimeout(int
      seconds) also affects the amount of time the client driver is waiting
      for a query to finish. For instance, setting the login timeout to 10
      seconds will result in any queries taking more than 10 seconds to fail
      with the following exception:

      Exception thrown: java.sql.SQLException: A communications error has been detected: Read timed out.
      java.sql.SQLException: A communications error has been detected: Read timed out.
      at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:46)
      at org.apache.derby.client.am.SqlException.getSQLException(SqlException.java:345)
      at org.apache.derby.client.am.Statement.executeQuery(Statement.java:414)
      at LoginTimeout.main(LoginTimeout.java:53)
      Caused by: org.apache.derby.client.am.DisconnectException: A communications error has been detected: Read timed out.
      at org.apache.derby.client.net.NetAgent.throwCommunicationsFailure(NetAgent.java:408)
      at org.apache.derby.client.net.Reply.fill(Reply.java:176)
      at org.apache.derby.client.net.Reply.ensureALayerDataInBuffer(Reply.java:215)
      at org.apache.derby.client.net.Reply.readDssHeader(Reply.java:317)
      at org.apache.derby.client.net.Reply.startSameIdChainParse(Reply.java:1147)
      at org.apache.derby.client.net.NetStatementReply.readPrepareDescribeOutput(NetStatementReply.java:51)
      at org.apache.derby.client.net.StatementReply.readPrepareDescribeOutput(StatementReply.java:40)
      at org.apache.derby.client.net.NetStatement.readPrepareDescribeOutput_(NetStatement.java:139)
      at org.apache.derby.client.am.Statement.readPrepareDescribeOutput(Statement.java:1341)
      at org.apache.derby.client.am.Statement.flowExecute(Statement.java:1977)
      at org.apache.derby.client.am.Statement.executeQueryX(Statement.java:420)
      at org.apache.derby.client.am.Statement.executeQuery(Statement.java:405)
      ... 1 more
      Caused by: java.net.SocketTimeoutException: Read timed out
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:129)
      at org.apache.derby.client.net.Reply.fill(Reply.java:174)
      ... 11 more

      1. derby-2026_diff.txt
        8 kB
        Kathey Marsden
      2. DERBY2026_LoginTimeout_diff_patch1.txt
        0.5 kB
        Mamta A. Satoor
      3. LoginTimeout.java
        2 kB
        Olav Sandstaa
      4. LoginTimeoutWithDataSource.java
        2 kB
        Kathey Marsden

        Issue Links

          Activity

            People

            • Assignee:
              Mamta A. Satoor
              Reporter:
              Olav Sandstaa
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development