Good Morning Paul
getNumActive and getNumIdle are methods of BasicDataSource take a look at
http://mckoi.com/database/maillist/msg04621.html
for a complete example...
Hope this helps,
Martin-
----- Original Message ----- From: "Paul Danese" <[EMAIL PROTECTED]>
To: <user@struts.apache.org>
Sent: Tuesday, October 04, 2005 9:06 AM
Subject: finding a resource leak commons.dbcp


Hi,

I'm running a struts application using the
commons.dbcp BasicDataSource as part of a connection
pool for interacting with a MySQL database.

I *think* my application has a pool 'leak' in that it
will periodically 'hang' until I re-start the server,
but I'm not positive about this explanation.

Questions:
1. are there any other (obvious) possible explanations
for periodic haning of a struts application?  I say
this b/c I've looked at the code and it looks to my
untrained eye that I'm closing all database
connections.
2. Is there a simple way to monitor the # of live
connections that my pool has 'handed out'?  in looking
at the api for commons.dbcp, I notice that
BasicDataSource has a field called connectionPool,
which is of the type, GenericObjectPool. GenericObjectPool itself has methods called
getNumActive and getNumIdle, but I can't seem to
figure out how to get to them.

Thanks for any info!




__________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com

---------------------------------------------------------------------
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]

Reply via email to