Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 35954 invoked from network); 19 Feb 2006 15:47:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 19 Feb 2006 15:47:11 -0000 Received: (qmail 60593 invoked by uid 500); 19 Feb 2006 15:47:10 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 60565 invoked by uid 500); 19 Feb 2006 15:47:10 -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 60556 invoked by uid 99); 19 Feb 2006 15:47:10 -0000 X-ASF-Spam-Status: No, hits=1.3 required=10.0 tests=SPF_FAIL X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 19 Feb 2006 07:47:08 -0800 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id DE667DF for ; Sun, 19 Feb 2006 16:46:47 +0100 (CET) Message-ID: <396507644.1140364007909.JavaMail.jira@ajax.apache.org> Date: Sun, 19 Feb 2006 16:46:47 +0100 (CET) From: "Kathey Marsden (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Updated: (DERBY-210) Network Server will leak prepared statements if not explicitly closed by the user until the connection is closed In-Reply-To: <1527603664.1113181887106.JavaMail.jira@ajax.apache.org> 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-210?page=all ] Kathey Marsden updated DERBY-210: --------------------------------- Comment: was deleted > Network Server will leak prepared statements if not explicitly closed by the user until the connection is closed > ---------------------------------------------------------------------------------------------------------------- > > Key: DERBY-210 > URL: http://issues.apache.org/jira/browse/DERBY-210 > Project: Derby > Type: Bug > Components: Network Client > Reporter: Kathey Marsden > Assignee: Deepa Remesh > Attachments: DOTS_ATCJ2_Derby-noPatch.png, DOTS_ATCJ2_Derby-withPatch.png, derby-210-patch1.diff, derby-210-patch2.diff, derby-210-patch2.status, derby-210-patch3.diff, derby-210-patch4-v2.diff, derby-210-patch4-v2.status, derby-210-v2-draft.diff, derby-210-v2-draft.status, derbyStress.java > > Network server will not garbage collect prepared statements that are not explicitly closed by the user. So a loop like this will leak. > ... > PreparedStatement ps; > for (int i = 0 ; i < numPs; i++) > { > ps = conn.prepareStatement(selTabSql); > rs =ps.executeQuery(); > while (rs.next()) > { > rs.getString(1); > } > rs.close(); > // I'm a sloppy java programmer > //ps.close(); > } > > To reproduce run the attached program > java derbyStress > Both client and server will grow until the connection is closed. > > It is likely that the fix for this will have to be in the client. The client does not send protocol to close the prepared statement, but rather reuses the PKGNAMCSN on the PRPSQLSTT request once the prepared statement has been closed. This is how the server knows to close the old statement and create a new one. -- 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