Database: db2, Application Server: websphere 8
We have rest service that updates/retrieves values in/from database. This service is used at most twice a day. So time period between the rest calls is almost 24 hours.
For every first/second request, it is throwing staleConnection
exception.
Third retry goes through.
Did everything that is specified in below links.
How to handle stale connections?
http://www.thejavacode.com/websphere-adapters-stale-connection-problem-t34.html
But still getting staleConnection
exception. We are using Spring JDBC, so I don't see issue of not closing connections after use. In addition, I wrote retry logic within a single request to try getting valid connection for three times when it encounters connection exception.
When staleconnection
exception is encountered first time, service waits three seconds and retries connection, but subsequent retries is throwing
ObjectClosedException: DSRA9110E: Connection is closed.
I doubt subsequent retries are trying to open existing stale connection. How to resolve this issue?
My apologies if I included wrong tags.