You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by AMIR-TAHMASSEB Marc <MA...@cus-strasbourg.net> on 2003/12/09 09:29:24 UTC

Struts and commons DBCP

Hi,
I'm using struts 1.02 and the commons DBCP to connect my Oracle 8i database and i have some problems because sometimes my tomcat 3 fall down without any reasons and we have to restart it.
 
I wonder to know how work the connection with commons DBCP, more specialy what happen wen i do a getConnection at my BasicDataSource ?
 
My second question is : do i have to close the connection when may request is finished ? Does this really close the connection or just free the object i used, but save the oracle connection open ?
 
thank for your responses,
 
Marc
 
--
Marc AMIR-TAHMASSEB
mamir-tahmasseb@cus-strasbourg.net
 

Re: Struts and commons DBCP

Posted by Kwok Peng Tuck <pe...@makmal.net>.
Hi Amir,

        If you are really using a connection pool, then calling the 
close method just returns it to the pool for other use. Yes, you do have 
to return any connection you 'borrowed' from the pool, otherwise if you 
don't eventually you will run out of connections that the pool can give 
out to other requests.

AMIR-TAHMASSEB Marc wrote:

> Hi,
> I'm using struts 1.02 and the commons DBCP to connect my Oracle 8i 
> database and i have some problems because sometimes my tomcat 3 fall 
> down without any reasons and we have to restart it.
>  
> I wonder to know how work the connection with commons DBCP, more 
> specialy what happen wen i do a getConnection at my BasicDataSource ?
>  
> My second question is : do i have to close the connection when may 
> request is finished ? Does this really close the connection or just 
> free the object i used, but save the oracle connection open ?
>  
> thank for your responses,
>  
> Marc
>  
> --
> Marc AMIR-TAHMASSEB
> mamir-tahmasseb@cus-strasbourg.net 
> <ma...@cus-strasbourg.net>
>  
>
>------------------------------------------------------------------------
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


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


RE: Struts and commons DBCP

Posted by Navjot Singh <na...@net4india.net>.
tomcat 3? guess that was a stone age :-)

My second question is : do i have to close the connection when may request
is finished ? Does this really close the connection or just free the object
i used, but save the oracle connection open ?

Yes, please close the connection. Actually, this method gets trapped by
PooledConnection interface and the connection will be returned back to the
db pool and it WONT get closed.

HTH
Navjot Singh