Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 75828 invoked from network); 29 Sep 2004 19:39:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 29 Sep 2004 19:39:13 -0000 Received: (qmail 54022 invoked by uid 500); 29 Sep 2004 19:38:50 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 53852 invoked by uid 500); 29 Sep 2004 19:38:47 -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: "Derby Development" Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 53551 invoked by uid 99); 29 Sep 2004 19:38:43 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [192.18.33.10] (HELO exchange.sun.com) (192.18.33.10) by apache.org (qpsmtpd/0.28) with SMTP; Wed, 29 Sep 2004 12:38:41 -0700 Received: (qmail 24376 invoked from network); 29 Sep 2004 19:40:35 -0000 Received: from localhost (HELO nagoya) (127.0.0.1) by nagoya.betaversion.org with SMTP; 29 Sep 2004 19:40:35 -0000 Message-ID: <767757744.1096486835156.JavaMail.apache@nagoya> Date: Wed, 29 Sep 2004 12:40:35 -0700 (PDT) From: derby-dev@db.apache.org To: derby-dev@db.apache.org Subject: [jira] Created: (DERBY-24) Client should not be able to raise an event on a PooledConnection it no longer owns. Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://issues.apache.org/jira/browse/DERBY-24 Here is an overview of the issue: --------------------------------------------------------------------- Key: DERBY-24 Summary: Client should not be able to raise an event on a PooledConnection it no longer owns. Type: Bug Status: Unassigned Priority: Minor Project: Derby Components: JDBC Versions: 10.0.2.0 Assignee: Reporter: Ramandeep Kaur Created: Wed, 29 Sep 2004 12:40 PM Updated: Wed, 29 Sep 2004 12:40 PM Description: Opening this bug on behalf of Daniel Debrunner. --------------------------------------------------------------- After closing a connection Derby generates a connectionErrorOccurred() event on the PooledConnection when a createStatement() call is made against the closed Connection. The code gets a Connection from the PooledConnection, creates a Statement, and then closes the Connection. This causes a connectionClose() event, like it's supposed to. Then it closes it again, which does not raise an exception (the spec doesn't really say what should happen if you close it twice, so it's hard to claim this is an error...). A second connectionClose() event is not generated, which is fine. The testcase then calls createStatement() again on the closed Connection. This generates a connectionErrorOccurred() event on the PooledConnection, which seems wrong. The connection pool code at this point is going to figure that the PooledConnection is bad and needs to be discarded, even though it's fine. (The second createStatement() call receives a SQLException, which is fine.) The code which receives the error event has to assume that the event is associated with the current user of the PooledConnection. When the first Connection.close() occurs, we will move the PooledConnection into the free pool, and then assign it to the next Connection requester. If the first Connection client erroneously calls createStatement() on their closed Connection facade, the Derby Connection facade generates that error event which refers to the PooledConnection now being used by the second client. But the code will have to assume that the second Connection client received an unrecoverable error, and that the PooledConnection needs to be closed, when in fact the first connection client has made a programming error. There's no way for to tell which client caused the error. The upshot is that any events should be generated after the close event caused by close(), no matter what is done to that closed Connection facade, since the client's not supposed to be using it anymore. The reference for connection pooling semantics is: http://java.sun.com/products/jdbc/jdbc20.stdext.pdf It doesn't explicitly say what should happen if an error occurs on a closed Connection, but it seems like the current behavior will confuse the connection pool built on top of PooledConnection. --------------------------------------------------------------------- JIRA INFORMATION: 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 If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira