Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 67236 invoked from network); 8 Sep 2006 00:35:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 Sep 2006 00:35:57 -0000 Received: (qmail 37200 invoked by uid 500); 8 Sep 2006 00:35:57 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 37158 invoked by uid 500); 8 Sep 2006 00:35:57 -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 37148 invoked by uid 99); 8 Sep 2006 00:35:57 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Sep 2006 17:35:57 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Sep 2006 17:35:56 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id DF50541000B for ; Fri, 8 Sep 2006 00:32:22 +0000 (GMT) Message-ID: <22034036.1157675542884.JavaMail.jira@brutus> Date: Thu, 7 Sep 2006 17:32:22 -0700 (PDT) From: "Rajesh Kartha (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-1737) Network Server should check for current open and active connections before shutting down a database In-Reply-To: <25307050.1156174754107.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/DERBY-1737?page=comments#action_12433282 ] Rajesh Kartha commented on DERBY-1737: -------------------------------------- I think it is fair enough to make this particular issue as a feature or an improvement. However I strongly feel that any connections currently open during the shutdown should have been invalidated. This would have indicated the correct info - that there are no open connections during the 'show connections' command and the subsequent 'set connection' and sql fails with appropriate errors. It works as expected in embedded mode, but it is more important to behave accordingly in the case of Network Server where multiple users are connected, rather than throw an obscure error of "ERROR 58009: A network protocol error was encountered and the connection ............. implementation-specific condition for which there was no architected message " I assume the issue of connection invalidation deserves a new JIRA entry in that case. -- --Connection A is still open -- ij> show connections; CONNA - jdbc:derby://localhost:1527/testdb;create=true No current connection -- --Set connection to connection A -- ij> set connection connA; -- --Try a sql -- ij> select * from t; ERROR 58009: A network protocol error was encountered and the connection has been terminated: the requested command encountered an unarchitected and implementation-specific condition for which there was no architected message ij> > Network Server should check for current open and active connections before shutting down a database > --------------------------------------------------------------------------------------------------- > > Key: DERBY-1737 > URL: http://issues.apache.org/jira/browse/DERBY-1737 > Project: Derby > Issue Type: Bug > Components: Network Server > Affects Versions: 10.0.2.0 > Environment: Any > Reporter: Rajesh Kartha > Attachments: shutdown.sql, shutdown_embed.sql > > > When a database shutdown is issued using the 'shutdown=true' by a client, the network server does not check for any active > connections and shuts down the respective database. As a result queries on the active connection start failing. > I would expect the right behaviour should be to throw an error mentioning shutdown was not performed since there are open connections > to the database. > Here is a sample output: > ij version 10.2 > ij> connect 'jdbc:derby://localhost:1527/testdb;create=true' as connA; > ij> drop table t; > 0 rows inserted/updated/deleted > ij> create table t (id int); > 0 rows inserted/updated/deleted > ij> insert into t values (1); > 1 row inserted/updated/deleted > ij> insert into t values (2); > 1 row inserted/updated/deleted > ij> select * from t; > ID > ----------- > 1 > 2 > 2 rows selected > -- > --Connection A is still open > -- > ij> connect 'jdbc:derby://localhost:1527/testdb' as connB; > ij(CONNB)> insert into t values (3); > 1 row inserted/updated/deleted > ij(CONNB)> select * from t; > ID > ----------- > 1 > 2 > 3 > 3 rows selected > -- > -- Should error out saying there are open connections to the database > -- > ij(CONNB)> connect 'jdbc:derby://localhost:1527/testdb;shutdown=true'; > ERROR 08006: DERBY SQL error: SQLCODE: -1, SQLSTATE: 08006, SQLERRMC: Database 'testdb' shutdown. > ij(CONNB)> disconnect; > -- > --Connection A is still open > -- > ij> show connections; > CONNA - jdbc:derby://localhost:1527/testdb;create=true > No current connection > -- > --Set connection to connection A > -- > ij> set connection connA; > -- > --Try a sql > -- > ij> select * from t; > ERROR 58009: A network protocol error was encountered and the connection has been terminated: the requested command encountered an unarchitected and implementation-specific condition for which there was no architected message > ij> > This issue kind of exists in embeddded also but since the database was booted in the same JVM, one can argue there is more control on the connections made to the database from the current JVM. In embedded the ''shutdown=true' closes all active connections to the database. > ij(CONNB)> connect 'jdbc:derby:testdb;shutdown=true'; > ERROR 08006: Database 'testdb' shutdown. > ij(CONNB)> disconnect; > -- > -- Shows no current connections after a shutdown > -- > ij> show connections; > No current connection > ij> set connection connA; > IJ ERROR: No connection exists with the name CONNA > ij> select * from t; > IJ ERROR: Unable to establish connection > ij> -- 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