RE: Database connections aren't being released...

2005-10-07 Thread George Sexton
Really,

http://findbugs.sourceforge.net/

It analyzes source code and points out where resources are not freed.

Of course the real problem with Findbugs is everyone is too embarrassed to
say how well it worked

George Sexton
MH Software, Inc.
http://www.mhsoftware.com/
Voice: 303 438 9585
  

> -Original Message-
> From: Richard Road Runner [mailto:[EMAIL PROTECTED] 
> Sent: Friday, October 07, 2005 4:41 PM
> To: Darryl L. Miles; Tomcat Users List
> Subject: Re: Database connections aren't being released...
> 
> Hmm..  Thank you for the reply.  Yes we are using DBCP.
> 
> I discussed this with our team and we going to pursue this as 
> a possible 
> cause.
> 
> Thanks again!!
> 
> 
> - Original Message - 
> From: "Darryl L. Miles" <[EMAIL PROTECTED]>
> To: "Tomcat Users List" 
> Cc: <[EMAIL PROTECTED]>
> Sent: Thursday, October 06, 2005 10:29 PM
> Subject: Re: Database connections aren't being released...
> 
> 
> > Richard Road Runner wrote:
> >
> >>I am not sure that this is a Tomcat issue, but we are not sure what 
> >>exactly is causing our problem.
> >>
> >>We are running Tomcat 5.0.27.  We are using the most recent 
> jconn2.jar 
> >>driver to connect to a Sybase SQL Anywhere Studio 7 
> database via JDBC.
> >>
> >>Over a period of time, the number of connections to the 
> database continues 
> >>to increase far beyond the possible number of users.  The 
> only way to 
> >>close the connections is to restart the database server.
> >>
> >>
> >>
> > Are you using DBCP ?
> >
> > I have an issue with 5.5.9 and DBCP shipped with it I found 
> 2 weeks ago. 
> > I would describe my problem as DBCP is not "reusing 
> database connections 
> > when it should" but it instead creates a new one, until the 
> SQL server has 
> > too many connections (or your DBCP hits upper parameter limits).
> >
> > With TC and MySQL I can confirm this by logging my database 
> handle close 
> > and watching what happens with "SHOW PROCESSLIST" sql 
> command on the 
> > server.   Each request needs 1 database connection and the 
> logging should 
> > confirm it returns (releases) the connection back to DBCP 
> pool.  I have 
> > followed this path with the debugger and got inside DBCP to 
> prove the 
> > release takes place.
> >
> > I had put down the problem and just configured up my DBCP 
> parameters to 
> > expire old connections as fast as possible and up the 
> maximum limits. 
> > This wont work for me in production, maybe I switch to C3P0 
> connection 
> > pooling at that time.
> >
> > Its just so difficult to help out and nail the problem with 
> TCs refactored 
> > and repackaged DBCP, I would very much appreciate an SDK 
> version of the 
> > full TC package that includes all source in the JARs.  I am 
> doing a CVS 
> > build.xml now, but I think this will be for 5.5.12, I just 
> need to work 
> > out how to fix the version for a 5.5.9 release and compare 
> the two trees 
> > to maybe try and nail this one, or at least confirm the 
> blame here is with 
> > DBCP.
> >
> > -- 
> > Darryl L. Miles
> >
> > 
> 
> 
> -
> 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: Database connections aren't being released...

2005-10-07 Thread Richard Road Runner

Hmm..  Thank you for the reply.  Yes we are using DBCP.

I discussed this with our team and we going to pursue this as a possible 
cause.


Thanks again!!


- Original Message - 
From: "Darryl L. Miles" <[EMAIL PROTECTED]>

To: "Tomcat Users List" 
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, October 06, 2005 10:29 PM
Subject: Re: Database connections aren't being released...



Richard Road Runner wrote:

I am not sure that this is a Tomcat issue, but we are not sure what 
exactly is causing our problem.


We are running Tomcat 5.0.27.  We are using the most recent jconn2.jar 
driver to connect to a Sybase SQL Anywhere Studio 7 database via JDBC.


Over a period of time, the number of connections to the database continues 
to increase far beyond the possible number of users.  The only way to 
close the connections is to restart the database server.





Are you using DBCP ?

I have an issue with 5.5.9 and DBCP shipped with it I found 2 weeks ago. 
I would describe my problem as DBCP is not "reusing database connections 
when it should" but it instead creates a new one, until the SQL server has 
too many connections (or your DBCP hits upper parameter limits).


With TC and MySQL I can confirm this by logging my database handle close 
and watching what happens with "SHOW PROCESSLIST" sql command on the 
server.   Each request needs 1 database connection and the logging should 
confirm it returns (releases) the connection back to DBCP pool.  I have 
followed this path with the debugger and got inside DBCP to prove the 
release takes place.


I had put down the problem and just configured up my DBCP parameters to 
expire old connections as fast as possible and up the maximum limits. 
This wont work for me in production, maybe I switch to C3P0 connection 
pooling at that time.


Its just so difficult to help out and nail the problem with TCs refactored 
and repackaged DBCP, I would very much appreciate an SDK version of the 
full TC package that includes all source in the JARs.  I am doing a CVS 
build.xml now, but I think this will be for 5.5.12, I just need to work 
out how to fix the version for a 5.5.9 release and compare the two trees 
to maybe try and nail this one, or at least confirm the blame here is with 
DBCP.


--
Darryl L. Miles





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Database connections aren't being released...

2005-10-06 Thread Darryl L. Miles

Richard Road Runner wrote:


I am not sure that this is a Tomcat issue, but we are not sure what exactly is 
causing our problem.

We are running Tomcat 5.0.27.  We are using the most recent jconn2.jar driver 
to connect to a Sybase SQL Anywhere Studio 7 database via JDBC.

Over a period of time, the number of connections to the database continues to 
increase far beyond the possible number of users.  The only way to close the 
connections is to restart the database server.


 


Are you using DBCP ?

I have an issue with 5.5.9 and DBCP shipped with it I found 2 weeks 
ago.  I would describe my problem as DBCP is not "reusing database 
connections when it should" but it instead creates a new one, until the 
SQL server has too many connections (or your DBCP hits upper parameter 
limits).


With TC and MySQL I can confirm this by logging my database handle close 
and watching what happens with "SHOW PROCESSLIST" sql command on the 
server.   Each request needs 1 database connection and the logging 
should confirm it returns (releases) the connection back to DBCP pool.  
I have followed this path with the debugger and got inside DBCP to prove 
the release takes place.


I had put down the problem and just configured up my DBCP parameters to 
expire old connections as fast as possible and up the maximum limits.  
This wont work for me in production, maybe I switch to C3P0 connection 
pooling at that time.


Its just so difficult to help out and nail the problem with TCs 
refactored and repackaged DBCP, I would very much appreciate an SDK 
version of the full TC package that includes all source in the JARs.  I 
am doing a CVS build.xml now, but I think this will be for 5.5.12, I 
just need to work out how to fix the version for a 5.5.9 release and 
compare the two trees to maybe try and nail this one, or at least 
confirm the blame here is with DBCP.


--
Darryl L. Miles



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: RE: Database connections aren't being released...

2005-10-06 Thread Richard Road Runner
I've confirmed that we added the parameter removeAbandoned="true" to the 
Database resource in the server.xml about a year ago and it had no effect.
None of us think that we are not closing connecitons properlly.

RE: Database connections aren't being released...

2005-10-06 Thread George Sexton
As many people have pointed out, your app is probably not closing resources.
A tool that can help find these is:

http://findbugs.sourceforge.net/


George Sexton
MH Software, Inc.
http://www.mhsoftware.com/
Voice: 303 438 9585
  

> -Original Message-
> From: Richard Road Runner [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, October 05, 2005 6:01 PM
> To: Tomcat Users List
> Subject: Database connections aren't being released...
> 
> I am not sure that this is a Tomcat issue, but we are not 
> sure what exactly is causing our problem.
> 
> We are running Tomcat 5.0.27.  We are using the most recent 
> jconn2.jar driver to connect to a Sybase SQL Anywhere Studio 
> 7 database via JDBC.
> 
> Over a period of time, the number of connections to the 
> database continues to increase far beyond the possible number 
> of users.  The only way to close the connections is to 
> restart the database server.
> 
> Again, we are not sure if we should be looking at Tomcat, the 
> JDBC driver, or Sybase to solve this problem.
> 
> Any input would be helpful.
> 
> Thanks
> 
> 
> 
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Database connections aren't being released...

2005-10-05 Thread Nikola Milutinovic

Richard Road Runner wrote:


I am not sure that this is a Tomcat issue, but we are not sure what exactly is 
causing our problem.

We are running Tomcat 5.0.27.  We are using the most recent jconn2.jar driver 
to connect to a Sybase SQL Anywhere Studio 7 database via JDBC.

Over a period of time, the number of connections to the database continues to 
increase far beyond the possible number of users.  The only way to close the 
connections is to restart the database server.

Again, we are not sure if we should be looking at Tomcat, the JDBC driver, or 
Sybase to solve this problem.
 



Your web app is not properly closing connections (resources, in general).

Nix.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Database connections aren't being released...

2005-10-05 Thread Caldarale, Charles R
> From: Richard Road Runner [mailto:[EMAIL PROTECTED] 
> Subject: Database connections aren't being released...
> 
> Over a period of time, the number of connections to the 
> database continues to increase far beyond the possible number 
> of users.

This is usually a problem in the webapp, in that some code path is
failing to close a result set, statement, or connection.  After a while,
these accumulate and you run out.  If you're using connection pooling,
you can try setting removeAbandoned="true", but that's a kludge, not a
true fix.  For more details, see:
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jndi-datasource-examples
-howto.html

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Database connections aren't being released...

2005-10-05 Thread Richard Road Runner
I am not sure that this is a Tomcat issue, but we are not sure what exactly is 
causing our problem.

We are running Tomcat 5.0.27.  We are using the most recent jconn2.jar driver 
to connect to a Sybase SQL Anywhere Studio 7 database via JDBC.

Over a period of time, the number of connections to the database continues to 
increase far beyond the possible number of users.  The only way to close the 
connections is to restart the database server.

Again, we are not sure if we should be looking at Tomcat, the JDBC driver, or 
Sybase to solve this problem.

Any input would be helpful.

Thanks