This error appears in a JVMs SystemOut.log.
[5/14/18 22:09:03:340 CDT] 000000fcc FreePool E J2CA0045E: Connection not available while invoking method example for resource /path/to/resource
This error suggests some issue connecting to a database, such as DB2, Oracle, or MySQL. For example, there may be latency in the response from the database (possibly due to a semaphore timeout), which produces the above error and other related errors in the JVM logs. Before doing any troubleshooting on the WebSphere side, check on the database side, to see if there is indeed some issue with the database. Since this issues is due to some issues with the connection to the database, it is unlikely that restarting the application or restarting the JVM will resolve the issue.
If no problems can be found with the database, the following can be done to capture data that will help in the analysis of this issue. Restart the application, and then immediately do the following steps, to ensure the tracing is enabled before the application makes a connection to the database.
Watch the SystemOut.log. If J2CA0045E continues to appear, issue the following wsadmin command.
wsadmin -c "$AdminControl invoke [$AdminControl queryNames \"*:name=<your datasource name>,process=<SERVER NAME>,node=<NODE NAME>,j2eeType=JDBCDataSource,*\"] showPoolContents" -user <admin username> -password <admin pasword>
By default, a data source is configured to have 10 maximum connections. If you determine that more than 10 connections to the data source are needed, increase the maximum connections.
By default, a data source is configured to cache 10 prepared statements. If you determine that more than 10 prepared statements need to cached, update the data source to cache more than 10 prepared statements.