You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Richard Road Runner <rj...@nc.rr.com> on 2005/10/06 02:01:17 UTC

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




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

Posted by Nikola Milutinovic <Ni...@ev.co.yu>.
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: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


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

Posted by George Sexton <gs...@mhsoftware.com>.
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:rjadrian@nc.rr.com] 
> 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" <da...@netbauds.net>
> To: "Tomcat Users List" <to...@jakarta.apache.org>
> Cc: <rj...@nc.rr.com>
> 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: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


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

Posted by Richard Road Runner <rj...@nc.rr.com>.
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" <da...@netbauds.net>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Cc: <rj...@nc.rr.com>
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: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


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

Posted by "Darryl L. Miles" <da...@netbauds.net>.
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: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


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

Posted by George Sexton <gs...@mhsoftware.com>.
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:rjadrian@nc.rr.com] 
> 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: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org