This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes JDBC and the fly likes Help in tracking down open database connections Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Help in tracking down open database connections" Watch "Help in tracking down open database connections" New topic
Author

Help in tracking down open database connections

David Maywis
Greenhorn

Joined: Mar 05, 2007
Posts: 1
I've inherited a large JBoss codebase that is, somewhere, not closing it's DB connections. I'm seeing errors like:

org.jboss.util.NestedSQLException: No ManagedConnections available within configured blocking timeout ( 30000 [ms] ); - nested throwable: (javax.resource.ResourceException: No ManagedConnections available within configured blocking timeout ( 30000 [ms] )) Exception caught while getting connection to java:/H2ST: No ManagedConnections available within configured blocking timeout ( 30000 [ms] ); - nested throwable: (javax.resource.ResourceException: No ManagedConnections available within configured blocking timeout ( 30000 [ms] ))

I don't believe our load is sufficent to be causing these, it must be unclosed connections somewhere. Does anyone know a good way to track down such connections? Unfortunately, the database code is scattered around the codebase, and it is proving difficult to manually check.

We are using a javax.sql.Datasource as our connection factory, is it possible to query this about the open connections? Or, does anyone have any good methods or tools for tracking down open connections?

Thanks for any advice,
David M.
 
wood burning stoves
 
subject: Help in tracking down open database connections