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

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. I

Re: Right way to close database connection pool

2009-08-06 Thread Nikola Milutinovic
or closing it while TC is up and running. Nix. From: Christopher Schultz To: Tomcat Users List Sent: Wednesday, August 5, 2009 7:35:40 PM Subject: Re: Right way to close database connection pool -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Filip, On 8/5/20

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 InitialContex

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 applic

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? Whe

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"); ((Ba

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: and in WEB-INF/web.xml: jdbc/myDS javax.sql.DataSource

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: and in WEB-INF/web.xml: jdbc/myDS javax.sql.DataSource Container Then I do the following in my code: InitialContext ctx = new InitialContext(); DataSource ds = (DataSource) ctx.lookup("java:com