Skip site navigation (1) Skip section navigation (2)

Re: pooled prepared statements

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Thomas Finneid <tfinneid(at)fcon(dot)no>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: pooled prepared statements
Date: 2009-05-13 00:44:08
Message-ID: 4A0A17D8.5020808@opencloud.com (view raw or flat)
Thread:
Lists: pgsql-jdbc
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

In response to

Responses

pgsql-jdbc by date

Next:From: dmpDate: 2009-05-13 01:13:20
Subject: Re: Unable to access table named "user"
Previous:From: Guy RouillierDate: 2009-05-12 20:19:37
Subject: Re: Enums - from java to jpa

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group