Avoiding StaleConnectionException on WebSphere Application Server

StaleConnectionException is one of the most popular issues that occur when one implements an application that employs JDBC to connect to a database through WAS' connection pool. Depending on the container's connection pool settings, it keeps stale (no longer usable due to database failure) connections. Therefore when your application gets a new connection and tries to use it, it will fail. As recommended by IBM, I have implemented several approaches to detect stale connections, and retry. Although OK, the retry approach is ... Read more