RE: connection pooling mysql (Pool Exhausted exception)

2006-01-14 Thread George Sexton
 -Original Message-
 From: Daniel Blumenthal [mailto:[EMAIL PROTECTED] 
 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: connection pooling mysql (Pool Exhausted exception)

2006-01-13 Thread Daniel Blumenthal
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();

 -Original Message-
 From: Khawaja Shams [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, January 12, 2006 4:14 PM
 To: Tomcat Users List
 Subject: connection pooling mysql (Pool Exhausted exception)
 
 Hello,
I am consistently getting exceptions about my connection 
 pool being exhausted in my application.  I am curious where I 
 can configure the number of connections tomcat should 
 maintain in the connection pool.  Lastly, am I right in 
 assuming that the only thing I need to do in order to return 
 a connection to the pool is to return to close the 
 connection? Do I have to do anything about the statements I 
 have created using that connection? Thanks in advance.  for your help.
 
 
 Best Regards,
 Khawaja Shams
 



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