commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sitowitz, Paul" <PSitow...@verisign.com>
Subject RE: [dbcp] question regarding connection pooling and prepared statements
Date Wed, 19 Oct 2005 20:39:40 GMT
Bill,

Prepared Statements are on a per-connection level. In fact, if you turn
on DBCP PrepareStatement pooling, a separate PrepareStatement pool will
be maintained for each Db connection. The PreparedStatement therefore is
tightly coupled with the connection that created it.

Paul

-----Original Message-----
From: Hudson, Bill [mailto:bhudson@extol.com] 
Sent: Wednesday, October 19, 2005 3:34 PM
To: commons-user@jakarta.apache.org
Subject: [dbcp] question regarding connection pooling and prepared
statements

 
Question: I am trying to determine if commons-dbcp provides this
functionality: Can a prepared statement be generated against a
connection obtained from the a connection pool, say "connection x".
Then can connection x be returned to the pool, and at a later time can
the prepared statement be used with a different connection, say
"connection y", obtained from the same connection pool (both connections
against same database, using the same driver).  In other words, if I
maintain a reference to a prepared statement, will that reference be
valid regardless of what connection the underlying pool provides to me
over the course of my application's execution time?

To phrase the question differently: are prepared statements on a
per-connection level, or are they "global" to all connections in the
connection pool?


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message