Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 5BAD3633C11 for ; Tue, 12 May 2009 22:23:50 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 90897-04 for ; Tue, 12 May 2009 22:23:44 -0300 (ADT) Received: from mx3.hub.org (mx3.hub.org [206.223.169.73]) by mail.postgresql.org (Postfix) with ESMTP id CBF19633B18 for ; Tue, 12 May 2009 22:23:44 -0300 (ADT) X-Greylist: delayed 00:39:19.638558 by SQLgrey-1.7.6 Received: from tremor.opencloud.co.nz (tremor.opencloud.co.nz [131.203.101.230]) by mx3.hub.org (Postfix) with ESMTP id 4B37A37B85D for ; Tue, 12 May 2009 22:23:44 -0300 (ADT) Received: from 219-89-243-186.adsl.xtra.co.nz ([219.89.243.186] helo=[192.168.1.3]) by tremor.opencloud.co.nz with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1M42Zt-0007gA-J8; Wed, 13 May 2009 12:44:09 +1200 Message-ID: <4A0A17D8.5020808@opencloud.com> Date: Wed, 13 May 2009 12:44:08 +1200 From: Oliver Jowett User-Agent: Thunderbird 2.0.0.21 (X11/20090318) MIME-Version: 1.0 To: Thomas Finneid CC: pgsql-jdbc@postgresql.org Subject: Re: pooled prepared statements References: <4A0978A3.6030900@fcon.no> In-Reply-To: <4A0978A3.6030900@fcon.no> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200905/69 X-Sequence-Number: 19619 Thomas Finneid wrote: > When a PreparedStatment is created by a pooled connection, as far as I > understand if, that creation happens on the server side, and a > reference, of sorts, is returned to the client jdbc. More or less, yes. (Assuming you're reusing the statement, not just using it once and discarding it). > Is that prepared statement shared among the connections or is it only > available to that single connection? It is associated only with the connection that prepared the statement. The preparation of the statement on the server side is state that's specific to the connection, and it's not shared between server backend processes - so the JDBC driver couldn't share statements between connections even if it wanted to. > and more importantly, can many > connections use that prepared statement concurrently? No. -O