--- Mikkel Heisterberg <[EMAIL PROTECTED]> wrote: > Hi there, > > I writing a custom connection pool for a project > under Tomcat (written as > the dbcp using the javax.naming.spi.ObjectFactory > interface). The > connection pool doesn't implement the > javax.sql.DataSource interface. I suppose my answer to the rest of this is correct, but I'm not sure what all you are doing here and if there is some API to register an ObjectFactory within Tomcat or not...none that I know of anyways as I don't know of anything in the standards which permits this, but that doesn't mean Tomcat doesn't have some support itself. I'm pretty sure it doesn't.
> > For the connection pool I need some lifecycle > management and in that > regard I was wondering how dbcp makes sure all the > connections are closed > when the application server shuts down. I can see > from the source that the > org.apache.commons.dbcp.BasicDataSource class has a > close() method but I > cannot see how it is called upon server termination. > > Does any of you guys know? > > Mikkel Heisterberg > > Med venlig hilsen / Best regards, > > Mikkel Heisterberg You have to do this yourself using a listener within your web application upon application shutdown. Obviously if the VM terminates abnormally this won't matter and you'll have some connection creep, but that's the way the cookie crumbles. There is no finalize method or reference listening code to clean up if you don't specifically call close. None that I have ever seen. Wade --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
