sijms / go-ora

Pure go oracle client
MIT License
800 stars 177 forks source link

Connection state not reflective on certain error cases. #455

Closed DrHayt closed 11 months ago

DrHayt commented 12 months ago

There are two sets of errors that can occur which cause the driver to believe that it is still connected, but it is in fact an invalid connection.

The first set of errors are *net.OpErrors which tend to occur when long running connections have been disconnected by some external network resources. These are typically firewalls that may be between where the code is running and where the database exists.

The second set of errors are network.OracleErrors which can happen during connection termination on the oracle server side, or on process kills on the oracle server.

In each case, it seems more appropriate to detect the condition and mark the connection as bad so that a new connection will be established.