Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 26482 invoked from network); 14 Sep 2007 16:45:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Sep 2007 16:45:53 -0000 Received: (qmail 63101 invoked by uid 500); 14 Sep 2007 16:45:46 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 63071 invoked by uid 500); 14 Sep 2007 16:45:46 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 63062 invoked by uid 99); 14 Sep 2007 16:45:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Sep 2007 09:45:46 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Sep 2007 16:45:52 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 45728714159 for ; Fri, 14 Sep 2007 09:45:32 -0700 (PDT) Message-ID: <19177305.1189788332280.JavaMail.jira@brutus> Date: Fri, 14 Sep 2007 09:45:32 -0700 (PDT) From: "Kathey Marsden (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Created: (DERBY-3077) Trying to reconnect with derby client after bringing server down throws SQL Exception 58009 rather than 08XXX exception MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Trying to reconnect with derby client after bringing server down throws SQL Exception 58009 rather than 08XXX exception ----------------------------------------------------------------------------------------------------------------------- Key: DERBY-3077 URL: https://issues.apache.org/jira/browse/DERBY-3077 Project: Derby Issue Type: Bug Reporter: Kathey Marsden This issue was discussed in DERBY-401, because the case where the server is brought down and an application tries to reconnect does not throw a SQLNonTransientException. Discussion is still underway about whether 58XXX exceptions should be SQLNonTransientExceptions, but at least for this case changing the exception to 08006 per Knut's suggestion should correct the problem for this case. See https://issues.apache.org/jira/browse/DERBY-401#action_12527400 Below is current stack and test case. Apache Derby got connection now sleep now try to use the connection after you killed the nS Exception in thread "main" java.sql.SQLException: A communications error has been detected: Software caused connection abort: recv failed. 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 DerbyClientNonXA.main(DerbyClientNonXA.java:48) Caused by: org.apache.derby.client.am.DisconnectException: A communications error has been detected: Software caused connection abort: recv failed. at org.apache.derby.client.net.NetAgent.throwCommunicationsFailure(Unknown Source) 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) ... 3 more Caused by: java.net.SocketException: Software caused connection abort: recv failed at java.net.SocketInputStream.read(SocketInputStream.java:129) ... 15 more import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.PreparedStatement; import java.sql.SQLException; import java.sql.Statement; import javax.sql.PooledConnection; public class DerbyClientNonXA { public static void main(String args[]) throws Exception { org.apache.derby.jdbc.ClientConnectionPoolDataSource40 ds = new org.apache.derby.jdbc.ClientConnectionPoolDataSource40(); Connection conn = null; ds.setDatabaseName("e:\\temp\\sampl127;create=true"); PooledConnection pooledCon = ds.getPooledConnection(); conn = pooledCon.getConnection(); DatabaseMetaData md = conn.getMetaData(); System.out.println(md.getDatabaseProductVersion()); System.out.println(md.getDatabaseProductName()); System.out.println("got connection now sleep. Bring down network server."); Statement st = null; PreparedStatement ps1 = null; st = conn.createStatement(); try { st.executeUpdate("drop table TAB1"); } catch (SQLException x) { System.out.println("no table exists"); } Thread.sleep(15000); System.out.println("now try to use the connection after you killed the nS"); ps1 = conn.prepareStatement("CREATE TABLE TAB1(COL1 INT NOT NULL)"); ps1.executeUpdate(); conn.commit(); System.out.println("done"); } } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.