e.g. TranscationManager:
public SpiTransaction createTransaction(boolean explicit, int isolationLevel) {try{ ... Connection c = dataSource.getConnection(); ... t.setBatchMode(true); ... c.setTransactionIsolation(isolationLevel); return t;}catch (SQLException ex) { throw new PersistenceException(ex); }}
If setBatchMode() or setTranscationIsolation() fails, the connection is lost. It should be closed in the catch clause. Otherwise, at some point in the future, there are too many open connections or the connection pool run out of available connections.
There might other places in the source code where the same problem occurs. All connection allocations have to be checked.
fixed in HEAD.