[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tomcat-user
Subject:    RE: connection pooling mysql (Pool Exhausted exception)
From:       "George Sexton" <gsexton () mhsoftware ! com>
Date:       2006-01-14 16:53:56
Message-ID: 20060114165356.976F728BA0 () mail ! mhsoftware ! com
[Download RAW message or body]

> -----Original Message-----
> From: Daniel Blumenthal [mailto:daniel@wordchamp.com] 
> Sent: Friday, January 13, 2006 8:51 PM
> To: 'Tomcat Users List'
> Subject: RE: connection pooling mysql (Pool Exhausted exception)
> 
> I received a similar (identical?) error when I was first 
> starting up, and
> the solution was to be very careful to ALWAYS close ResultSets.
> 
> ResultSet rset = stmt.executeQuery("select foo from bar where ID=7");
> int foo = rset.getInt(1);
> rset.close();
> 

You might want to look at FindBugs

http://findbugs.sourceforge.net/

It is really good at finding these kinds of issues in programs
automatically.

My coding cycle usually goes:

Code a Module
Fix Compile Errors
Run FindBugs, Lint, and PMD
Fix reported issues

Test/Debug

By using automated code analysis tools, the test/debug cycle is about 1/4th
to 1/2 of the normal length. This is because FindBugs/Lint/PMD catch things
like assigned values to variables that are not used, unused variables,
invalid object comparisons, questionable casts, and such. 

The other two tools I referenced are:

PMD

http://pmd.sourceforge.net/

Enerjy Analyzer:

http://www.enerjy.com/for-developers/code-analysis.html


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


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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic