This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes JBoss/WildFly and the fly likes running out of ManagedConnections available Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "running out of ManagedConnections available" Watch "running out of ManagedConnections available" New topic

running out of ManagedConnections available

Karen Gomes
Ranch Hand

Joined: Aug 25, 2003
Posts: 60
Hello Friends,

I'm connecting jboss 3.2.3 with SQL server. My project uses session n entity beans and seems to work fine for less load. We are now facing a strange problem. I've set the <max-pool-size> in mssql-ds.xml file to default ie 20, enabled the Trace in the log files that tells me how many jdbc connections are [InUse/Available/Max] from the pool.

This is my mssql-ds.xml

<!-- sql to call when connection is created
<new-connection-sql>some arbitrary sql</new-connection-sql>
<!-- sql to call on an existing pooled connection when it is obtained from pool
<check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>

Everything works fine if I send less than 18 requests to the server simultaneously. The problem crops up when the requests exceed 18 .... coz these 18 requests use the 20 max connections. Instead of waiting for connections to be free from the pool they time out giving me an exception.

18:51:27,462 ERROR [LogInterceptor] EJBException, causedBy:
org.jboss.util.NestedSQLException: No ManagedConnections available within configured blocking timeout ( 5000 [ms] ); - nested throwable: (javax.resource.ResourceExcep
No ManagedConnections available within configured blocking timeout ( 5000 [ms] )

I can see all the 20 connections in use at one point. But they don't get freed up after being used for the remaining requests.

When I increase the number of max connections it works fine. But again if I max the connections to 100 and send even 100 requests it throws the exception. I'm not sure where the problem exists. Is it the instance pool or the connection pool that has a problem here.

Has anyone ever had encountered such a problem before?

I agree. Here's the link:
subject: running out of ManagedConnections available
It's not a secret anymore!