JdbcTransactionFactory does this:
public ConnectionReleaseMode getDefaultReleaseMode() {
return ConnectionReleaseMode.ON_CLOSE;
}
This seems to be a mistake because:
1) In section 13.5. Connection release modes of the 4.1.4.Final Core Reference Manual it says:
for JDBCTransactionFactory, [org.hibernate.transaction.TransactionFactory.getDefaultReleaseMode()] returns ConnectionReleaseMode.AFTER_TRANSACTION
2) In ConnectionReleaseMode.java it says:
/**
- Indicates that JDBC connections should be released after each transaction
- ends (works with both JTA-registered synch and HibernateTransaction API).
- This mode may not be used with an application server JTA datasource.
- <p/>
- This is the default mode starting in 3.1; was previously {@link #ON_CLOSE}.
*/
AFTER_TRANSACTION("after_transaction"),
You can work around this by setting hibernate.connection.release_mode=after_transaction
|