RE: When does tomcat call the garbage collector?
Hello, In that case, you'd want to write a class that implements javax.servlet.ServletContextListener to manually shutdown your pool classes when the webapp is stopped. This is handy for webapp reloads during development, too. - Mike Johnson On Fri, 2003-09-26 at 12:34, Bruce W. Marriner wrote: > For some reason I figured when tomcat shutdown, along with the JVM > <-- it would finalize any open classes. And with that action it would > close the open connections. Yes the open connections will die after a > set value, some x odd hours. It is rather easy to control the number > of pooled connection and close them while tomcat is running. But it's > the shutdown part I'm concerned about. But when 200 some odd users > are using an app it's rather slow to run everyone off a single DB > connection :). Is there some way to tell JVM to finalize all open > classes at exit? Some command-line argument or com call, or > something... > > -Original Message- > From: Filip Hanik [mailto:[EMAIL PROTECTED] > Sent: Friday, September 26, 2003 2:15 PM > To: Tomcat Users List > Subject: Re: When does tomcat call the garbage collector? > > > it is your own responsibility to close connections from a pool. > Tomcat doesn't do garbage collection, the Java VM does. > Also, if you kill your VM and the connections are still open on the AS400 > box, tough luck, (I would imagine they should timeout shortly) that is out > of reach from the VM/Tomcat side, best thing you can do is to not keep a > pool of open connections, because if the VM crashes or gets killed, there > will be no one closing them from the client > > Filip > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: When does tomcat call the garbage collector?
You could set up a context or lifecycle listener. Then, when you shut down Tomcat you could close your connections in the respective contextDestroyed method or stop method. Subir -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Friday, September 26, 2003 12:15 PM To: Tomcat Users List Subject: Re: When does tomcat call the garbage collector? it is your own responsibility to close connections from a pool. Tomcat doesn't do garbage collection, the Java VM does. Also, if you kill your VM and the connections are still open on the AS400 box, tough luck, (I would imagine they should timeout shortly) that is out of reach from the VM/Tomcat side, best thing you can do is to not keep a pool of open connections, because if the VM crashes or gets killed, there will be no one closing them from the client Filip - Original Message - From: "Bruce W. Marriner" <[EMAIL PROTECTED]> To: "Tomcat Users List" <[EMAIL PROTECTED]> Sent: Friday, September 26, 2003 12:10 PM Subject: When does tomcat call the garbage collector? Hello I am working on a crm web app in jsp. I am pre-compiling everything with ant and serving them as servlets though tomcat. I am curious when tomcat does garbage collection on the servlets. For instance, if a servlet opens stuff up I would imagen when that page has finished executing it would clean up anything not properly cleaned up. The real issue... I have a dbHandler class that takes care of sql statements and connection pooling. I am using IBM's AS400JDBCConnectionPool class to handle the pool. If it has say 100 connections open, and you shutdown tomcat. They stay open on the AS400. I would think that some process would go though and close everything that is open when tomcat shuts down. I am compiling with JDK1.4.2_09 and running Tomcat 4.1.27 which is using JRE1.4.2 to execute the servlets. Any ideas would be helpful, thanks. Bruce Marriner - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: When does tomcat call the garbage collector?
For some reason I figured when tomcat shutdown, along with the JVM <-- it would finalize any open classes. And with that action it would close the open connections. Yes the open connections will die after a set value, some x odd hours. It is rather easy to control the number of pooled connection and close them while tomcat is running. But it's the shutdown part I'm concerned about. But when 200 some odd users are using an app it's rather slow to run everyone off a single DB connection :). Is there some way to tell JVM to finalize all open classes at exit? Some command-line argument or com call, or something... -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Friday, September 26, 2003 2:15 PM To: Tomcat Users List Subject: Re: When does tomcat call the garbage collector? it is your own responsibility to close connections from a pool. Tomcat doesn't do garbage collection, the Java VM does. Also, if you kill your VM and the connections are still open on the AS400 box, tough luck, (I would imagine they should timeout shortly) that is out of reach from the VM/Tomcat side, best thing you can do is to not keep a pool of open connections, because if the VM crashes or gets killed, there will be no one closing them from the client Filip - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: When does tomcat call the garbage collector?
it is your own responsibility to close connections from a pool. Tomcat doesn't do garbage collection, the Java VM does. Also, if you kill your VM and the connections are still open on the AS400 box, tough luck, (I would imagine they should timeout shortly) that is out of reach from the VM/Tomcat side, best thing you can do is to not keep a pool of open connections, because if the VM crashes or gets killed, there will be no one closing them from the client Filip - Original Message - From: "Bruce W. Marriner" <[EMAIL PROTECTED]> To: "Tomcat Users List" <[EMAIL PROTECTED]> Sent: Friday, September 26, 2003 12:10 PM Subject: When does tomcat call the garbage collector? Hello I am working on a crm web app in jsp. I am pre-compiling everything with ant and serving them as servlets though tomcat. I am curious when tomcat does garbage collection on the servlets. For instance, if a servlet opens stuff up I would imagen when that page has finished executing it would clean up anything not properly cleaned up. The real issue... I have a dbHandler class that takes care of sql statements and connection pooling. I am using IBM's AS400JDBCConnectionPool class to handle the pool. If it has say 100 connections open, and you shutdown tomcat. They stay open on the AS400. I would think that some process would go though and close everything that is open when tomcat shuts down. I am compiling with JDK1.4.2_09 and running Tomcat 4.1.27 which is using JRE1.4.2 to execute the servlets. Any ideas would be helpful, thanks. Bruce Marriner - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
When does tomcat call the garbage collector?
Hello I am working on a crm web app in jsp. I am pre-compiling everything with ant and serving them as servlets though tomcat. I am curious when tomcat does garbage collection on the servlets. For instance, if a servlet opens stuff up I would imagen when that page has finished executing it would clean up anything not properly cleaned up. The real issue... I have a dbHandler class that takes care of sql statements and connection pooling. I am using IBM's AS400JDBCConnectionPool class to handle the pool. If it has say 100 connections open, and you shutdown tomcat. They stay open on the AS400. I would think that some process would go though and close everything that is open when tomcat shuts down. I am compiling with JDK1.4.2_09 and running Tomcat 4.1.27 which is using JRE1.4.2 to execute the servlets. Any ideas would be helpful, thanks. Bruce Marriner - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]