Overview
You are getting this error on your production system after a few hours of work:
java.sql.SQLException: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/jdbc/SBMCommonDB
Eventually, the system becomes unresponsive and the server has to be restarted.
Full error stack:
Caused by: java.sql.SQLException: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/jdbc/SBMCommonDB
at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:151)
at org.apache.jsp.bpmportal.attachments_jsp._jspService(attachments_jsp.java:665)
... 67 more
Caused by: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/jdbc/SBMCommonDB
at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.getManagedConnection(AbstractConnectionManager.java:414)
at org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.getManagedConnection(TxConnectionManagerImpl.java:368)
at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:488)
at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:143)
... 68 more
Caused by: javax.resource.ResourceException: IJ000655: No managed connections available within configured blocking timeout (30000 [ms])
at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.getConnection(SemaphoreArrayListManagedConnectionPool.java:434)
at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getSimpleConnection(AbstractPool.java:404)
at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getConnection(AbstractPool.java:372)
at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.getManagedConnection(AbstractConnectionManager.java:353)
... 71 more
Solution
SBMCommonDB data source is mainly used by the BPM Portal.
This error indicates that there are no connections available in the connection pool.
This usually could be due to a connection leak when database connections are not closed after they are not needed anymore, or the pool size needs to be increased due to regular increased load on the system.
Increasing the connection pool size
Start debugging your issue by increasing the max connection pool size of the data source to 100 by configuring the <max-pool-size> property of the data source.
If the issue reappears after a few days, it means you have to do with a connection leak.
Identifying the connection leak
Identifying the connection leak can be done by identifying the applications using the SBMcommonDB data source and manually verifying their source code to ensure that the data source connections are closed after not being needed anymore (usually what is missing is a ServiceLocator.close() call).
After identifying the connection leaks, reduce your <max-pool-size> to its previous value (no need to have a big pool size if the system load does not require it).