Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 85391 invoked from network); 15 Aug 2005 16:38:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 15 Aug 2005 16:38:32 -0000 Received: (qmail 24066 invoked by uid 500); 15 Aug 2005 16:38:30 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 24047 invoked by uid 500); 15 Aug 2005 16:38:30 -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 24034 invoked by uid 99); 15 Aug 2005 16:38:30 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Aug 2005 09:38:30 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [192.18.98.34] (HELO brmea-mail-3.sun.com) (192.18.98.34) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Aug 2005 09:38:50 -0700 Received: from phys-mpk-1 ([129.146.11.81]) by brmea-mail-3.sun.com (8.12.10/8.12.9) with ESMTP id j7FGcSF2014341 for ; Mon, 15 Aug 2005 10:38:28 -0600 (MDT) Received: from conversion-daemon.mpk-mail1.sfbay.sun.com by mpk-mail1.sfbay.sun.com (iPlanet Messaging Server 5.2 HotFix 1.24 (built Dec 19 2003)) id <0IL900L01VAPYJ@mpk-mail1.sfbay.sun.com> (original mail from David.Vancouvering@Sun.COM) for derby-user@db.apache.org; Mon, 15 Aug 2005 09:38:27 -0700 (PDT) Received: from [129.150.30.121] (vpn-129-150-30-121.SFBay.Sun.COM [129.150.30.121]) by mpk-mail1.sfbay.sun.com (iPlanet Messaging Server 5.2 HotFix 1.24 (built Dec 19 2003)) with ESMTP id <0IL9002P0VJF1I@mpk-mail1.sfbay.sun.com> for derby-user@db.apache.org; Mon, 15 Aug 2005 09:38:03 -0700 (PDT) Date: Mon, 15 Aug 2005 09:38:14 -0700 From: David Van Couvering Subject: Re: PooledConnection being closed In-reply-to: To: Derby Discussion Message-id: <4300C4F6.4010208@sun.com> MIME-version: 1.0 Content-type: multipart/mixed; boundary="Boundary_(ID_6xN1hxUSZzxpW333SNsSaA)" X-Accept-Language: en-us, en User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) References: <1121180210.30679.ezmlm@db.apache.org> <43007598.8000808@cibecs.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. --Boundary_(ID_6xN1hxUSZzxpW333SNsSaA) Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT With the Connection.toString() that was just checked into the trunk (and I think Tomohito backported into the 10.1 branch) you can see if the underlying "physical" connection is the same... David Knut Anders Hatlen wrote: >Tony Seebregts writes: > > > >>Hi, >> >>I'm writing a connection pool manager using the >>EmbeddedConnectionPoolDatasource class. The requesting object gets the >>Connection object from a PooledConnection getConnection() , executes >>a SQL statement and then closes the Connection. >> >>This correctly invokes the ConnectionEventListener.close() method - >>which simply marks the pooled connection as available for reused. But >>when I try to resuse the connection originally supplied by the >>PooledConnection getConnection() method the connection is >>closed. Calling getConnection returns me a new Connection which is >>(AFAIK) not the idea. >> >> > >Well, the point with pooled connections is that you use >getConnection() and close() as with ordinary connections, but the >underlying physical connection is kept open. The Connection object >returned by getConnection() is a logical connection, and you cannot >use it after it is closed. If you call getConnection() again, you will >get a new logical connection, and therefore a new Connection >object. However, the new logical connection might still use the same >physical connection. > > > --Boundary_(ID_6xN1hxUSZzxpW333SNsSaA) Content-type: text/x-vcard; charset=utf-8; name=david.vancouvering.vcf Content-transfer-encoding: 7BIT Content-disposition: attachment; filename=david.vancouvering.vcf begin:vcard fn:David Van Couvering n:Van Couvering;David org:Sun Microsystems, Inc.;Database Technology Group email;internet:david.vancouvering@sun.com title:Senior Staff Software Engineer tel;work:510-550-6819 tel;cell:510-684-7281 x-mozilla-html:TRUE version:2.1 end:vcard --Boundary_(ID_6xN1hxUSZzxpW333SNsSaA)--