@jakarta.apache.org
Subject: How to release connections in connection pool during reload?
Hi,
I'm using Tomcat's connection pooling feature which is implemented with
Jakarta's DBCP to manage database access, and I just noticed that each time
when I do a reload (either via Ant or Tomcat manager), a database
to release connections in connection pool during reload?
Dustin,
Thanks! You''ve helped me to solve a prloblem that I've been struggling
with for days.
---
Lucie
Date: Fri, 7 Jan 2005 22:08:20 -0800 (PST)
From: Dustin [EMAIL PROTECTED]
Subject: How to release connections in connection pool during
Hi,
I'm using Tomcat's connection pooling feature which is implemented with
Jakarta's DBCP to manage database access, and I just noticed that each time
when I do a reload (either via Ant or Tomcat manager), a database
connection is added to the database server. Though this isn't a big problem
-datasource-examples-howto.html#Database%20Connection%20Pool%20(DBCP)%20Configurations
Doug
- Original Message -
From: Lucie Chan [EMAIL PROTECTED]
To: tomcat-user@jakarta.apache.org
Sent: Friday, January 07, 2005 11:40 PM
Subject: How to release connections in connection pool during reload
You need to release connections when you are done with them, con.close() ;
This is similar to using a direct connection to the jdbc except this
time the only difference is where you got the connection object from.
Calling con.close() ;
will release the driver back to the connection pool.
Lucie
In your servlet's destroy() method (I am using Struts
and plugins, and use the plugin's destroy() method),
add the following code:
((BasicDataSource) ds).close();
That is assuming your data source is named 'ds'. This
will close all connections.
Dustin
--- Lucie Chan [EMAIL PROTECTED] wrote:
Dustin,
Thanks! You''ve helped me to solve a prloblem that I've been struggling
with for days.
---
Lucie
Date: Fri, 7 Jan 2005 22:08:20 -0800 (PST)
From: Dustin [EMAIL PROTECTED]
Subject: How to release connections in connection pool during reload?
Content-Type: text/plain; charset=us-ascii