hi
The prepared statement once prepared always exists in the cache of the connection, but with connection pooling once I close the connection, the connection is returned to the pool. If I want to make use of the same prepared statement once again i.e., from the cache, how do I get the same prepared statement again, because I am not sure wheather I will get the same connection object again.
What I thought is whenever I make a request, a free connection object is returned from the connection pool.
can somebody answer this
-
prepared statements and connection pooling (5 messages)
- Posted by: satyaprasad chalasani
- Posted on: July 17 2001 14:14 EDT
Threaded Messages (5)
- prepared statements and connection pooling by Denis Baranov on July 17 2001 14:35 EDT
- prepared statements and connection pooling by Richard Kenyon on July 18 2001 02:28 EDT
- prepared statements and connection pooling by Denis Baranov on July 24 2001 13:44 EDT
-
prepared statements and connection pooling by tiger ceo on July 24 2001 11:25 EDT
- prepared statements and connection pooling by Denis Baranov on July 25 2001 02:38 EDT
-
prepared statements and connection pooling by tiger ceo on July 24 2001 11:25 EDT
- prepared statements and connection pooling by Denis Baranov on July 24 2001 13:44 EDT
-
prepared statements and connection pooling[ Go to top ]
- Posted by: Denis Baranov
- Posted on: July 17 2001 14:35 EDT
- in response to satyaprasad chalasani
You will have to hold on to the connection using which you create PreparedStatements you wish to reuse. You cannot release this connection to the pool, unfortunately. Besides, as of now, Connections do not perform Statement caching, this is part of proposed new version of the JDBC standard. You will have to do it yourself, most probably. And this is tricky (imagine if your connection becomes "bad": you will have to detect this, get rid of that connection and to purge statement cache).
Denis -
prepared statements and connection pooling[ Go to top ]
- Posted by: Richard Kenyon
- Posted on: July 18 2001 02:28 EDT
- in response to satyaprasad chalasani
Have a look at the following :-
http://theserverside.com/resources/article.jsp?l=Prepared-Statments
Cheers,
Rick
-
prepared statements and connection pooling[ Go to top ]
- Posted by: Denis Baranov
- Posted on: July 24 2001 13:44 EDT
- in response to Richard Kenyon
Not really... This is too simple when you create statement in the same context in which you use it. What I was trying to apply this to, was e.g. BMP Entity loading using cached PreparedStatements. Speed improvement was significant, if not staggering ;)
Denis. -
prepared statements and connection pooling[ Go to top ]
- Posted by: tiger ceo
- Posted on: July 24 2001 23:25 EDT
- in response to Denis Baranov
The preparedstatement optimize is processed( pre-compiled ) on the JDBC level or on the actual database level? -
prepared statements and connection pooling[ Go to top ]
- Posted by: Denis Baranov
- Posted on: July 25 2001 14:38 EDT
- in response to tiger ceo
Should be both ;) correct me if I'm wrong...