naveen, are you guys using guice-persist as a persistence provider ? We all agree this problem happens when there is a loss of connectivity when we're starting a transaction, Hibernate tries to disable auto-commit for the current connection. I had a look at guice-persist source code (JpaLocalTxnInterceptor.java), and when they do txn.begin() (line:62), they don't catch any potential exception which could be thrown by this action. By not catching it, they never call txn.rollback(), and this is in txn.rollback() that the connection is getting released by Hibernate (releaseManagedConnection in JdbcTransaction.java).
|