e.g. TransactionManager.createQueryTransaction():
If any statement (like setBatchMode or setAutoCommit) fails after the connection has been established (dataSource.getConnection), a persistence exception is thrown but the connection is NOT closed. This may lead to too many open connections or connection pools running out of connections.
Fix:close the connection in the catch(SQLException).
There might be more places in Ebean with the same problem.
Fixed in HEAD.