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 <[EMAIL PROTECTED]> 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:[EMAIL PROTECTED] 
> 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 <[EMAIL PROTECTED]> 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:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to