I see an issue here: the fact that ConnectionException is thrown for many different case makes it very hard to catch some cases and not others. And catching the exception in case there is no active transaction is something which may be useful