Details
Description
There's no check when returning an available connection from a Pool if that connection is valid yet.
The method getConnection on ConnectionPool check only if there is an available connection in the pool, but doesn't check if that connection is valid.
We work with a timeout on connections and Oracle may close sessions after some minutes if they are not used. So we obtain exception when trying to use that connections.
In the class ManagedPooledConnection there is the isValid() method that is not called from PoolConnection, but also if it did the isValid() method check the connection trying to close it.
I think it would be better to create a method that check validity of connection calling a rollback() on it. That method could be called from the getConnection method of ConnectioPool before returning the connection. If the connection is not valid anymore, it should create a new connection.
I think this issue is also on later versions!
Issue Links
- relates to
-
UDIG-1380
Error when connecting to PostGIS due to GeoTools Connection Pool implementation
-