Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 86548 invoked from network); 20 Feb 2006 19:21:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 20 Feb 2006 19:21:48 -0000 Received: (qmail 81451 invoked by uid 500); 20 Feb 2006 19:21:25 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 81413 invoked by uid 500); 20 Feb 2006 19:21:25 -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 81402 invoked by uid 99); 20 Feb 2006 19:21:25 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Feb 2006 11:21:25 -0800 X-ASF-Spam-Status: No, hits=1.9 required=10.0 tests=DNS_FROM_RFC_ABUSE,DNS_FROM_RFC_POST X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [32.97.182.145] (HELO e5.ny.us.ibm.com) (32.97.182.145) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Feb 2006 11:21:23 -0800 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e5.ny.us.ibm.com (8.12.11/8.12.11) with ESMTP id k1KJL1Sf019543 for ; Mon, 20 Feb 2006 14:21:01 -0500 Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by d01relay02.pok.ibm.com (8.12.10/NCO/VERS6.8) with ESMTP id k1KJL1ql219052 for ; Mon, 20 Feb 2006 14:21:01 -0500 Received: from d01av03.pok.ibm.com (loopback [127.0.0.1]) by d01av03.pok.ibm.com (8.12.11/8.13.3) with ESMTP id k1KJL1f5005375 for ; Mon, 20 Feb 2006 14:21:01 -0500 Received: from [127.0.0.1] (sig-9-48-114-249.mts.ibm.com [9.48.114.249]) by d01av03.pok.ibm.com (8.12.11/8.12.11) with ESMTP id k1KJKtQ4005151 for ; Mon, 20 Feb 2006 14:21:00 -0500 Message-ID: <43FA1696.5070409@sbcglobal.net> Date: Mon, 20 Feb 2006 11:20:54 -0800 From: Kathey Marsden User-Agent: Mozilla Thunderbird 0.7.3 (Windows/20040803) X-Accept-Language: en-us, en MIME-Version: 1.0 To: derby-dev@db.apache.org Subject: Re: DERBY-966 - holdability - dubious code in network server. References: <43FA0B0F.9050707@apache.org> In-Reply-To: <43FA0B0F.9050707@apache.org> X-Enigmail-Version: 0.85.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1 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 Daniel John Debrunner wrote: >I've think I've found a dubious piece of code that could be the cause of >DERBY-966, holdability issues with XA connections and Derby client. >This is within the server code. > >lines 513 DRDAStatement.java > >Connection conn = database.getConnection(); >if (conn instanceof BrokeredConnection) > ps = conn.prepareStatement(sqlStmt, scrollType, concurType); >else > ps = prepareStatementJDBC3(sqlStmt, scrollType, concurType, > withHoldCursor); > > >The 'if (conn instanceof BrokeredConnection)' is dubious. > > Yes, I think you are right . Not only dubious but badly broken as evidenced by DERBY-966 . DERBY-1005, and DERBY-1006. The wrong assumptions here (if I recall) were 1) That a BrokeredConnection meant we were in an XA transaction 2) For XA connections we could rely on the embedded server's process of switching to CLOSE_CURSORS_AT_COMMIT to avoid having such logic on the client. >I'm still looking through the code to understand how the holdability is >meant to work in jdk 13 and the network server, any pointers on that >would be helpful. > > > In general the way it works for both jdk14 and jdk13 is that the holdability is sent by the client in the PKGNAMCSN. This is parsed in parsePkgidToFindHoldability() to determine the holdability. Then statements are prepared using that value in prepareStatementJDBC3. For XA all of this is summarly ignored per the code above. Now it seems quite transparent that that is wrong, but oddly it seemed to make sense at the time. Kathey