No managed connections available within configured blocking timeout (JBoss 7 and Postgres) No managed connections available within configured blocking timeout (JBoss 7 and Postgres) database database

No managed connections available within configured blocking timeout (JBoss 7 and Postgres)


Your primary issue is probably a connection leak, but maybe not. In other words database transactions are leaving the pool and not being returned. In this case there are a few specific things to start with because the problem is probably a code problem and not a database problem.

The first thing to check is the current status of everything in pg_stat_activity. This includes the most recent query and the transaction state. In a connection leak you will probably find a large number of IDLE connections with similar queries. The queries can help you track down the connection leak. Also in a connection leak, when the problem starts, it will continue until you restart things.

In the event where the issue is in fact too few connections available, then you will see lots of ACTIVE connections. In that case increase the number of connections in your pool. Also in this case, the problem will occur intermittently and then appear to go on its own all by itself.