db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mamta A. Satoor (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (DERBY-3172) ConnectionEventListener.connectionErrorOccurred not being executed when SQLState 08006 Error is thrown
Date Tue, 27 Nov 2007 19:27:43 GMT

     [ https://issues.apache.org/jira/browse/DERBY-3172?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Mamta A. Satoor resolved DERBY-3172.
------------------------------------

       Resolution: Fixed
    Fix Version/s: 10.4.0.0
                   10.3.1.5

Merged changes into 10.3 codeline with revision 598712 and the commit comments were as follows


This commit merges into 10.3 codeline the 2 changes that went into trunk (595047 and 595803)
for DERBY-3172.

I had to modify the merged code for the 2 test files by adding code to start and stop network
server in jdbcapi.DataSourceTest and jdbc4.DataSourceTest.

In the trunk, these 2 functionalities of start and stop of network server are already available
in the TestConfiguration.java. This functionalities were added into trunk as part of checkin
574053 for DERBY-2855. I could merge the changes that went into  TestConfiguration to introduce
these 2 functionalities in 10.3 codeline but there is an outstanding jira issue about this
functionality causing derbynet.jar dependency. The jira issue is DERBY-3151 "Reduce dependency
on NetworkServerControl in TestConfiguration" Because of this, I opted to add start and stop
network server functionality in jdbcapi.DataSourceTest and jdbc4.DataSourceTest. I have updated
DERBY-3151 requesting that once we reach a resolution, we should migrate the changes into
10.3 codeline too so that individual tests requiring start and stop network server do not
have to write the code themselves, instead they can depend on the TestConfiguration.java or
some other class to provide that functionality. Once that work is done, jdbcapi.DataSourceTest
and jdbc4.DataSourceTest should be modified. I think in addition to these 2 tests, OutBufferedStream.java
and TestConnectionMethods.java also have start and stop network server code in 10.3 codeline.



> ConnectionEventListener.connectionErrorOccurred not being executed when SQLState 08006
Error is thrown
> ------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-3172
>                 URL: https://issues.apache.org/jira/browse/DERBY-3172
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.3.1.4
>            Reporter: Stan Bradbury
>            Assignee: Mamta A. Satoor
>             Fix For: 10.3.1.5, 10.4.0.0
>
>         Attachments: DerbyNotification2.java
>
>
> The attached program demonstrates the problem.  Using the ClientConnectionPoolDataSource40
with a connectionEventListener the defined method connectionErrorOccurred is not executed
after the Network Server is shutdown and activity is performed on a previously established
pooled connection.
> Program also demonstrates that the connectionClosed method is executed when the connection
is closed.
> To run the reproduction:
> 1) start network server (listening on default host/port and  -noSecurityManager specified)
> 2) run the program
> Output is:
>  > java DerbyNotification2
> 10.3.1.5 - (579866)
> Apache Derby
>  .got connection...check if connectionClosed method is called
> EVENT CALLED: Connection closed happened
>  . . .
>  . . .Get connection and issue test SQL statement
>  . . .AS EXPECTED: no table exists
>  . SHUTDOWN Network server and check if connectionErrorOccurred is called
> now try to use the connection after the NS is STOPPED
> SQLState is: 08006
> Error is: -4499
> Message is: Insufficient data while reading from the network - expected a minimum of
6 bytes and received only -1 bytes.  The connection has been terminated.
> Exception in thread "main" java.sql.SQLNonTransientConnectionException: Insufficient
data while reading from the network - expected a minimum of 6 bytes and received only -1 bytes.
 The connection has
>  been terminated.
>         at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.Connection.prepareStatement(Unknown Source)
>         at org.apache.derby.client.am.LogicalConnection.prepareStatement(Unknown Source)
>         at DerbyNotification2.runTest(DerbyNotification2.java:64)
>         at DerbyNotification2.main(DerbyNotification2.java:87)
> Caused by: org.apache.derby.client.am.DisconnectException: Insufficient data while reading
from the network - expected a minimum of 6 bytes and received only -1 bytes.  The connection
has been termina
> ted.
>         at org.apache.derby.client.net.Reply.fill(Unknown Source)
>         at org.apache.derby.client.net.Reply.ensureALayerDataInBuffer(Unknown Source)
>         at org.apache.derby.client.net.Reply.readDssHeader(Unknown Source)
>         at org.apache.derby.client.net.Reply.startSameIdChainParse(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.readPrepareDescribeOutput(Unknown
Source)
>         at org.apache.derby.client.net.StatementReply.readPrepareDescribeOutput(Unknown
Source)
>         at org.apache.derby.client.net.NetStatement.readPrepareDescribeOutput_(Unknown
Source)
>         at org.apache.derby.client.am.Statement.readPrepareDescribeOutput(Unknown Source)
>         at org.apache.derby.client.am.PreparedStatement.readPrepareDescribeInputOutput(Unknown
Source)
>         at org.apache.derby.client.am.PreparedStatement.flowPrepareDescribeInputOutput(Unknown
Source)
>         at org.apache.derby.client.am.PreparedStatement.prepare(Unknown Source)
>         at org.apache.derby.client.am.Connection.prepareStatementX(Unknown Source)
>         ... 4 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message