Hide
Sadly, only in java 1.6 we have Connection#isValid, so we used to try a simple query just to check whether a connection is still valid.
At least with postgresql, after another exception the complete transaction will only give exception, so even this simple query won't work. ( ERROR: current transaction is aborted, commands ignored until end of transaction block)
This results in closing the connection, which it should not have done, becuase it is still needed to roll back the transaction.
Show
Sadly, only in java 1.6 we have Connection#isValid, so we used to try a simple query just to check whether a connection is still valid.
At least with postgresql, after another exception the complete transaction will only give exception, so even this simple query won't work. ( ERROR: current transaction is aborted, commands ignored until end of transaction block)
This results in closing the connection, which it should not have done, becuase it is still needed to roll back the transaction.