From derby-user-return-5838-apmail-db-derby-user-archive=db.apache.org@db.apache.org Wed Dec 13 10:21:47 2006 Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 74698 invoked from network); 13 Dec 2006 10:21:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Dec 2006 10:21:46 -0000 Received: (qmail 62632 invoked by uid 500); 13 Dec 2006 10:21:52 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 62606 invoked by uid 500); 13 Dec 2006 10:21:50 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 62595 invoked by uid 99); 13 Dec 2006 10:21:50 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Dec 2006 02:21:50 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [192.18.1.36] (HELO gmp-ea-fw-1.sun.com) (192.18.1.36) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Dec 2006 02:21:39 -0800 Received: from d1-emea-09.sun.com (d1-emea-09.sun.com [192.18.2.119]) by gmp-ea-fw-1.sun.com (8.13.6+Sun/8.12.9) with ESMTP id kBDALF1U005988 for ; Wed, 13 Dec 2006 10:21:17 GMT Received: from conversion-daemon.d1-emea-09.sun.com by d1-emea-09.sun.com (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) id <0JA700901JCU6L00@d1-emea-09.sun.com> (original mail from Bernt.Johnsen@Sun.COM) for derby-user@db.apache.org; Wed, 13 Dec 2006 10:21:15 +0000 (GMT) Received: from localhost ([129.159.112.201]) by d1-emea-09.sun.com (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPSA id <0JA700M9VJFE05EW@d1-emea-09.sun.com> for derby-user@db.apache.org; Wed, 13 Dec 2006 10:21:15 +0000 (GMT) Date: Wed, 13 Dec 2006 11:21:14 +0100 From: "Bernt M. Johnsen" Subject: Re: Derby-638 not actually resolved ? In-reply-to: Sender: Bernt.Johnsen@Sun.COM To: Derby Discussion Message-id: <20061213102114.GA30522@atum01.norway.sun.com> Organization: Sun Microsystems MIME-version: 1.0 Content-type: multipart/signed; boundary="W/nzBZO5zC0uMSeA"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-disposition: inline References: <45767FD3.3060105@Sun.com> <20061206093836.GA18787@atum01.norway.sun.com> <20061212123747.GE14663@atum01.norway.sun.com> User-Agent: Mutt/1.5.10i X-Virus-Checked: Checked by ClamAV on apache.org --W/nzBZO5zC0uMSeA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, I'm still not able to figure out what's wrong. Are you able to write a reproduction of the bug which I may run? >>>>>>>>>>>> Xanana Gusmao wrote (2006-12-13 04:18:45): > Bernt, >=20 > > 3) I would really hae liked to take peek at the connection pool your > > are using to figure out what happens here. Where does this JdbcUtil > > you are using coe from. Equinox? >=20 > Well I'm using Apache DBCP for the connection pool. However I don't get t= his > error when using the pool. I get this error when I'm directly creating the > connections via DriverManager. >=20 > Anyway the code snippet that I provided at the start of the thread wasn't= the > actual code, line by line. In fact I have an additional closeStatement, a= s shown > below. >=20 > finally > { > JdbcUtil.closeStatement( statementRowLock ); //2 > JdbcUtil.closeStatement( statementAddByOne ); //3 > JdbcUtil.closeConnection( conn ); //4 > } >=20 > Query for "statementRowLock": > select NUM from SEQUENCE where TYPE =3D ? FOR UPDATE >=20 > Query for "statementAddByOne": > update SEQUENCE set NUM =3D ? where TYPE =3D ? >=20 > I learn new things everyday. And today, when I restored the closeStatemen= ts to > take place prior to the closeConnection (line marked 4); I discovered th= at it > is the line marked 2 that's causing the SQLException. If I removed line 2= , then > the code executes fine. >=20 > Note that JdbcUtil.closeStatement(..) looks like this. >=20 > if (statement =3D=3D null) return; =20 > statement.close(); >=20 > Basically after calling Statement.close(); > inUnitOfWork_ was changed to true within > org.apache.derby.client.net.NetConnection.close(). >=20 > And this leads to the SQLException. QED. >=20 --=20 Bernt Marius Johnsen, Database Technology Group,=20 Staff Engineer, Technical Lead Derby/Java DB Sun Microsystems, Trondheim, Norway --W/nzBZO5zC0uMSeA Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFFf9QZlFBD9TXBAPARAvulAJ9d9fZJvHQTKBIOtkFCfnbHcLMAWQCfSJ9A 094pLEY/xxaRGruJDTCRjeU= =GrzX -----END PGP SIGNATURE----- --W/nzBZO5zC0uMSeA--