Re: Right way to close database connection pool

2009-08-06 Thread Nikola Milutinovic
it while TC is up and running. Nix. From: Christopher Schultz ch...@christopherschultz.net To: Tomcat Users List users@tomcat.apache.org Sent: Wednesday, August 5, 2009 7:35:40 PM Subject: Re: Right way to close database connection pool -BEGIN PGP SIGNED

RE: Right way to close database connection pool

2009-08-06 Thread Caldarale, Charles R
From: Nikola Milutinovic [mailto:alok...@yahoo.com] Subject: Re: Right way to close database connection pool I understand your point of view - you have that one web application and it is using the pool and you are seeing something that looks like a leak. If I understand the situation

Re: Right way to close database connection pool

2009-08-06 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Filip, On 8/5/2009 5:02 PM, Filip Hanik - Dev Lists wrote: and if you don't want to depend on a specific implementation, use reflection Since this is a missing feature, would it be reasonable for Tomcat to provide a sample filter that webapps can

Right way to close database connection pool

2009-08-05 Thread Kirill Ilyukhin
I use database connection pool which is described in webapp's META-INF/context.html: Context Resource auth=Container scope=Unshareable name=jdbc/myDS type=javax.sql.DataSource driverClassName=org.postgresql.Driver url=jdbc:postgresql://server/db ... / /Context

Re: Right way to close database connection pool

2009-08-05 Thread Filip Hanik - Dev Lists
you would need to listen for context destroyed, and cast the datasource to call close() on it Filip On 08/05/2009 10:43 AM, Kirill Ilyukhin wrote: I use database connection pool which is described in webapp's META-INF/context.html: Context Resource auth=Container scope=Unshareable

Re: Right way to close database connection pool

2009-08-05 Thread Mark Shifman
I do it in a contextListener. something like this: public void contextDestroyed(ServletContextEvent event) { Context initContext = new InitialContext(); Context envContext = (Context) initContext.lookup(java:/comp/env);

Re: Right way to close database connection pool

2009-08-05 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Filip, On 8/5/2009 1:05 PM, Filip Hanik - Dev Lists wrote: you would need to listen for context destroyed, and cast the datasource to call close() on it When Tomcat re-deploys an application, is the existing DataSource trashed and re-created? When

Re: Right way to close database connection pool

2009-08-05 Thread Filip Hanik - Dev Lists
On 08/05/2009 11:35 AM, Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Filip, On 8/5/2009 1:05 PM, Filip Hanik - Dev Lists wrote: you would need to listen for context destroyed, and cast the datasource to call close() on it When Tomcat re-deploys an

Re: Right way to close database connection pool

2009-08-05 Thread Filip Hanik - Dev Lists
and if you don't want to depend on a specific implementation, use reflection On 08/05/2009 11:10 AM, Mark Shifman wrote: I do it in a contextListener. something like this: public void contextDestroyed(ServletContextEvent event) { Context initContext = new