[ http://issues.apache.org/jira/browse/DERBY-2026?page=all ]

Olav Sandstaa updated DERBY-2026:
---------------------------------

    Attachment: LoginTimeout.java

This is a repro showing that setting the login timeout to 10 seconds makes the 
folloiwng query to fail with the exception shown in the JIRA report. 

To run the repro:

1. start a Derby network server
2. update the jdbcUrl in the java program with the correct server and port 
number
3. Run the repro program. This program should produce the execption after about 
10 seconds.

To make the program succeed, remove the call to 
DriverManager.setLoginTimeout(). Note that the program then might
take about 2 to 10 minutes to complete the query.

This repro will fail to reproduce the bug if you have a machine that is much 
faster than than the one I am using or if you are running on an operating 
system that does not support setting a timeout on blocking socket calls.

> Setting a login timeout in client driver can lead to query timeout
> ------------------------------------------------------------------
>
>                 Key: DERBY-2026
>                 URL: http://issues.apache.org/jira/browse/DERBY-2026
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC, Network Client
>    Affects Versions: 10.3.0.0
>         Environment: Client driver on most platforms
>            Reporter: Olav Sandstaa
>            Priority: Minor
>         Attachments: LoginTimeout.java
>
>
> 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

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to