How can I avoid ResourceExceptions when sending more requests for database connections from the connection pool than are currently available?
The fundamental problem is too few resources (database connections in the connection pool) for the work load. The correct response is to increase the maximum number of connections in the connection pool. Optimally designed applications only require the server to have one pool connection per execute thread.
A. The fundamental problem is too few resources (database connections in the connection pool) for the work load. The correct response is to increase the maximum number of connections in the connection pool. Optimally designed applications only require the server to have one pool connection per execute thread. You can also enable connection requests to wait for a connection. See “Enabling Connection Requests to Wait for a Connection” in Programming WebLogic JDBC. Note that the proper application response to a resource exception is not to retry the request in a tight loop, which would tie up execute threads on the server. You should design your application to gracefully fail if no connections are available. Try to ensure that you get the connection as late as possible in your application code and return it to the connection pool as early as possible so that you do not see as many NoResource exceptions. It is better to have the connection as a method level variable and close the connectio
Related Questions
- How can I ensure that database security is applied to the current user when I use a connection pool since the connections are created with a default user ID and password?
- How can I avoid ResourceExceptions when sending more requests for database connections from the connection pool than are currently available?
- Can I enable requests to a JDBC connection pool for a database connection to wait until a connection is available?