Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 93907 invoked from network); 27 Feb 2006 18:45:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 27 Feb 2006 18:45:34 -0000 Received: (qmail 21619 invoked by uid 500); 27 Feb 2006 18:45:32 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 21580 invoked by uid 500); 27 Feb 2006 18:45:31 -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 21571 invoked by uid 99); 27 Feb 2006 18:45:31 -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; Mon, 27 Feb 2006 10:45:22 -0800 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id 3700ADD for ; Mon, 27 Feb 2006 19:44:55 +0100 (CET) Message-ID: <816883805.1141065895223.JavaMail.jira@ajax.apache.org> Date: Mon, 27 Feb 2006 19:44:55 +0100 (CET) From: "Deepa Remesh (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Updated: (DERBY-1002) Check that DRDAStatement and DRDAResultSet states are reset when they are re-used In-Reply-To: <2090826006.1140195927391.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-1002?page=all ] Deepa Remesh updated DERBY-1002: -------------------------------- Attachment: derby1002-patch2-v2.diff derby1002-patch2-v2.status Attaching 'derby1002-patch2-v2.diff' for Bryans' comments in the following derby-dev mail: http://www.nabble.com/Re%3A-jira-Updated%3A-%28DERBY-1002%29-Check-that-DRDAStatement-and-DRDAResultSet-states-are-reset-when-they-are-re-used-p3135530.html This patch modifies only one file: lang/procedure.java. With this patch, I have re-run lang/procedure.java. Please take a look at following two patches - patch 1 contains code changes and patch 2 contains tests. These have to be committed together. ------------------------------------------ 1. derby1002-patch1-v1 ------------------------------------------ * Adds reset() methods to DRDAStatement and DRDAResultSet objects. The purpose of reset method is to reset the states of all variables so that the objects can be re-used and will not have left-over states. * In case of DRDAStatement, the following variables are not reset: + * 1. database - This variable gets initialized in the constructor and by + * call to setDatabase. + * 2. members which get initialized in setPkgnamcsn (pkgnamcsn, pkgcnstkn, + * pkgid, pkgsn, isolationLevel, cursorName). pkgnamcsn is the key used to + * find if the DRDAStatement can be re-used. Hence its value will not change + * when the object is re-used. * close() methods are changed to only close and dereference objects. * DRDAStatement.rsClose() method is not used in close() or reset(). This method has some checks which were causing the method to return without resetting currentDrdaRs. Now, close() calls currentDrdaRs.close() and reset() calls currentDrdaRs.reset(). * In Database.newDrdaStatement, close() method is called followed by reset() when the server finds the statement can be re-used. ------------------------------------------ 2. derby1002-patch2-v2 ------------------------------------------ Modifies test lang/procedure.java. Adds a method 'setupStatementReuse' which creates and uses statements in such a way as to provoke re-use of statements and result sets on network server. This method is called from tests for jira-491 and 'testImplicitClose'. ------------------------------------------------------------------------------------ Remaining TODOs for DERBY-1002 ------------------------------------------------------------------------------------ * pkgcnstkn, pkgid, pkgsn variables can be removed from DRDAStatement since these are derived from pkgnamcsn object. * Look into what is required by initialize() of default statement. Currently, initialize just calls setTypDefValues(). Once the purpose of this method is confirmed, we may need to modify the comments at places it is currently called. NOTE: patch 1 contains code changes and patch 2 contains tests. These have to be committed together. > Check that DRDAStatement and DRDAResultSet states are reset when they are re-used > --------------------------------------------------------------------------------- > > Key: DERBY-1002 > URL: http://issues.apache.org/jira/browse/DERBY-1002 > Project: Derby > Type: Bug > Components: Network Server > Reporter: Deepa Remesh > Assignee: Deepa Remesh > Fix For: 10.2.0.0 > Attachments: derby1002-patch1-draft1.diff, derby1002-patch1-draft1.status, derby1002-patch1-v1.diff, derby1002-patch1-v1.status, derby1002-patch2-v2.diff, derby1002-patch2-v2.status, derby1002.java > > Network server re-uses DRDAStatement and DRDAResultSet objects when client sends a request with same section number. When re-using DRDAStatement, it's close() method is called which inturn calls close() method of DRDAResultSet. For re-use to work properly, we have to ensure the states of these objects are reset. This is not a bug but it is an area for possible improvements like: > * The reset of all states are not in the close() methods. The states get re-initialized at different places in the code. Fo example, in case of DRDAResultSet, they get initialized in some other DRDAStatement methods - like addResultSet, setRsDefaultOptions, setOPNQRYOptions, setQueryOptions etc. It will be good to have all resets in one method. > * The method name "close" is confusing since it is also called when objects get re-used. For clarity, it may be good to have a method named reset(). And then have the close method call reset. -- 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