| This issue isn't just limited to errors like the ORA-03113. I've been testing the latest Oracle 12c driver and it now responds to interrupt events, i.e. it will allow interruption of a long running sql statement by aborting the connection. This interruption can come in the middle of the sql execution but I've also seen it happen during the rollback or commit phase as well. In the case of the AbstractLogicalConnectionImplementor it will eventually blow an exception out of the rollback since the connection is physically closed but it blows by all of the aftercompletion/cleanup logic. In the case where the session is autoconfigured to close after transaction completion this never occurs and the session is leaked. If you're using something like the ThreadLocalSessionContext the session instance is never unbound and is returned from the currentSession() call in a still open state with a reference to the invalid connection which cannot perform any type of operation since the connection is closed. I've found that if I put some additional handling around the rollback in our side of the code that I can force the session closed, which tries another rollback and fails but ultimately unbinds itself and the session does get into a closed state and is released. |