commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wade Chandler <>
Subject Re: [dbcp] Who/what calls BasicDataSource.close() in an application server (e.g. Tomcat)
Date Mon, 20 Feb 2006 17:04:28 GMT
--- Mikkel Heisterberg <>

> So in other words the only way to obtain this kind
> of functionality easily 
> would be a ServletContextListener which would get a
> reference to the 
> connection pool from JNDI and then close the
> connection pool, or using 
> some other (probably application server specific)
> life-cycle extension to 
> make sure the connection pool is properly closed.
> Bummer.
> P.S.: I guess changing the connection pool from
> being instantiated and put 
> in JNDI from a MBean instead of a Resource would
> also work.
> Thanks.
> Med venlig hilsen / Best regards, 
> Mikkel Heisterberg
Or since you have your own API just call the method
directly from the listener.  No need for JNDI unless
you are storing your reference already in JNDI.  Just
use some sort of a static instance or static factory. 
That would be the simpler way, and would work in any
servlet container meeting the spec you are using (2.2,
2.3, etc)


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message