You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jose Euclides da Silva Junior - DATAPREVRJ <Jo...@rj.previdenciasocial.gov.br> on 2003/10/09 01:18:40 UTC

Urgent help, please!Best practices using Connection Pool

Hi,
i am using DBCP 1.0. My question is simple: since DBCP doesnt create a
singleton object ( just a data source object), what should i do whenever my
sql queries are done? Should i close the connection after that? But, if i do
this, will i loose my connection pool facility, so my next connection time
will waste more time...
Thanks in advance,
Euclides.  

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


Re: Urgent help, please!Best practices using Connection Pool

Posted by Adam Hardy <ah...@cyberspaceroad.com>.
Hi Jose,
the connection that you are served by your data source is a connection 
wrapper where the close method will not really close the connection, 
rather it will tell the connection pool that this connection is free and 
can be put back in the pool.

HTH
Adam

PS I wouldn't flag your email as "urgent" - I doubt it makes much 
difference to how quickly you get an answer, and often it only serves to 
put people off from reading your mail at all, simply because it annoys 
them that you consider your email should have higher priority for some 
reason than everyone else's. As if everyone is sitting around happily 
chatting about really non-urgent things. (which they do sometimes, but 
mostly not).

On 10/09/2003 01:18 AM Jose Euclides da Silva Junior - DATAPREVRJ wrote:
> Hi,
> i am using DBCP 1.0. My question is simple: since DBCP doesnt create a
> singleton object ( just a data source object), what should i do whenever my
> sql queries are done? Should i close the connection after that? But, if i do
> this, will i loose my connection pool facility, so my next connection time
> will waste more time...
> Thanks in advance,
> Euclides.  
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 

-- 
struts 1.1 + tomcat 5.0.12 + java 1.4.2
Linux 2.4.20 RH9


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