-
Bug
-
Resolution: Not an Issue
-
P4
-
None
-
11
-
generic
-
generic
ADDITIONAL SYSTEM INFORMATION :
try(Connection conn = this.ds.getConnection()){
}
is translated to below code after decompiling class
try {
Connection conn = ds.getConnection();
......
if (conn != null) {
conn.close();
}
}
A DESCRIPTION OF THE PROBLEM :
I found the Apache JDBC pool exhausted quickly when there were lots of JDBC query/update exceptions, then I decompiled the code and found above problem. The "conn.close() is in try but not in finally block of the auto generated code.
Even the AutoCloseable would be closed after scope end in exception, but not guaranteed immediately, which is a bug when lots of exceptions happen continuously, and caused my problem above.
FREQUENCY : always
try(Connection conn = this.ds.getConnection()){
}
is translated to below code after decompiling class
try {
Connection conn = ds.getConnection();
......
if (conn != null) {
conn.close();
}
}
A DESCRIPTION OF THE PROBLEM :
I found the Apache JDBC pool exhausted quickly when there were lots of JDBC query/update exceptions, then I decompiled the code and found above problem. The "conn.close() is in try but not in finally block of the auto generated code.
Even the AutoCloseable would be closed after scope end in exception, but not guaranteed immediately, which is a bug when lots of exceptions happen continuously, and caused my problem above.
FREQUENCY : always