tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ALEX HYDE <alex.h...@btinternet.com>
Subject RE: database connection pooling
Date Tue, 22 Nov 2005 14:50:06 GMT
Khawaja,

Just to add to what the others said. When you close
the connection it doesn't actually close the
connection, it returns it to the pool. You close it to
return it, not to "actually" close it. It doesn't mean
literally terminate the connection, otherwise you're
right, there would not be much point in having a pool!

Not sure if this is what you meant or not.

--- KEREM ERKAN <kerem.erkan@basari.com.tr> wrote:

> When pooling on Tomcat, the connection must be
> closed.
> 
> I think, by saying "closing would defeat the purpose
> of connection pooling",
> Khawaja may be thinking about pooling in Tomcat as
> some persistent
> connection method, and while it is a persistent
> connection with Tomcat and
> the DB server which it connects to, the code that
> works on Tomcat sees the
> connection as a regular connection not a persistent
> connection. So unlike
> some persistent connection pooling methods (for
> example oci8 on php), in
> Tomcat, the connection must be closed, or it will
> hang unless some mechanism
> sets the connection as idle, or until Tomcat is
> restarted.
> 
> Regards,
> 
> Kerem
> 
> -----Original Message-----
> From: Caroline Jen [mailto:jiapei_jen@yahoo.com] 
> Sent: Tuesday, November 22, 2005 2:04 PM
> To: Tomcat Users List
> Subject: Re: database connection pooling
> 
> Hi, you should definitely close the connection right
> after the method that is invoked.  The connection
> should be closed in the 'finally' block.
> 
> May we know the reason why you think the closing
> would
> defeat the purpose of connection pooling?
> 
> --- Khawaja Shams <ksshams@gmail.com> wrote:
> 
> > Hello,
> > when using connection pooling, i get a connection
> > from the context. I am
> > curious if I am supposed to close this connection
> > when I am done using it.
> > To me, it seems like closing it would defeat the
> > purpose of connection
> > pooling. Any guidance would be appreciated. Thanks
> > in advance.
> > 
> > 
> > Best Regards,
> > Khawaja Shams
> > 
> 
> 
> 
> 	
> 		
> __________________________________ 
> Yahoo! Mail - PC Magazine Editors' Choice 2005 
> http://mail.yahoo.com
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail:
> users-help@tomcat.apache.org
> 



		
___________________________________________________________ 
Yahoo! Model Search 2005 - Find the next catwalk superstars - http://uk.news.yahoo.com/hot/model-search/

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


Mime
View raw message