Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 65471 invoked from network); 20 Feb 2006 18:32:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 20 Feb 2006 18:32:15 -0000 Received: (qmail 90318 invoked by uid 500); 20 Feb 2006 18:32:14 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 90295 invoked by uid 500); 20 Feb 2006 18:32:14 -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 90286 invoked by uid 99); 20 Feb 2006 18:32:14 -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 10:32:14 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [68.142.198.211] (HELO smtp112.sbc.mail.mud.yahoo.com) (68.142.198.211) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 20 Feb 2006 10:32:13 -0800 Received: (qmail 99498 invoked from network); 20 Feb 2006 18:31:52 -0000 Received: from unknown (HELO ?127.0.0.1?) (ddebrunner@sbcglobal.net@71.131.246.110 with plain) by smtp112.sbc.mail.mud.yahoo.com with SMTP; 20 Feb 2006 18:31:52 -0000 Message-ID: <43FA0B0F.9050707@apache.org> Date: Mon, 20 Feb 2006 10:31:43 -0800 From: Daniel John Debrunner User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.3) Gecko/20040910 X-Accept-Language: en-us, en, de MIME-Version: 1.0 To: derby-dev Subject: DERBY-966 - holdability - dubious code in network server. X-Enigmail-Version: 0.90.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii 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 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. For one it doesn't have comments, so I have to guess what the original coder was trying to do. (one more plug for code comments :-) >From the svn log it looks like this is really meant to be logic of the form, if running under jdk 13 do the first statement, else do the second statement. The bug is that the instanceof check is not an absolute class check, it is an instance of check, when we have an XA connection the connection object will be a BrokeredConnection or BrokeredConnection30. Since BrokeredConnection30 extends BrokeredConnection both of them are instances of BrokeredConnection, so the instanceof will always be true and so it looks like we lose holdability state in JDBC 3.0 and above. 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. Dan.