Bug 414 : Connection not closed in case of exception
Priority 
High
Reported Version 
 
Logged By 
Remo
Status 
Fixed
Fixed Version 
2.8.1
Assigned To 
 
Product 
Ebean - core
Duplicate Of 
 
Created 
20/07/2012
Updated 
20/07/2012
Type 
Bug
 
Attachments 
No attachments

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.

 
Rob 29 Jul 08:54
Fixed in HEAD

Fixed in HEAD.

woResponse

Upload a file