Skip to content

Commit 6218aef

Browse files
committed
Pstatementcache must be locked in closeConnectionFully
1 parent e8c042e commit 6218aef

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ebean-datasource/src/main/java/io/ebean/datasource/pool/PooledConnection.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ void closeConnectionFully(boolean logErrors) {
245245
Log.error("Error checking if connection [" + name + "] is closed", ex);
246246
}
247247
}
248+
lock.lock();
248249
try {
249250
for (ExtendedPreparedStatement ps : pstmtCache.values()) {
250251
ps.closeDestroy();
@@ -253,6 +254,8 @@ void closeConnectionFully(boolean logErrors) {
253254
if (logErrors) {
254255
Log.warn("Error when closing connection Statements", ex);
255256
}
257+
} finally {
258+
lock.unlock();
256259
}
257260
try {
258261
connection.close();

0 commit comments

Comments
 (0)