Skip to content

Commit b0c8ad4

Browse files
committed
Move the pool size dec() call to be earlier
And regardless of how well close executes/fails/slow etc
1 parent 07f9807 commit b0c8ad4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ void closeConnectionFully(boolean logErrors) {
246246
* this method performs network IO and may block
247247
*/
248248
void doCloseConnection(boolean logErrors) {
249+
pool.dec();
249250
long start = System.nanoTime();
250251
try {
251252
try {
@@ -280,7 +281,6 @@ void doCloseConnection(boolean logErrors) {
280281
}
281282
try {
282283
connection.close();
283-
pool.dec();
284284
} catch (SQLException ex) {
285285
if (logErrors || Log.isLoggable(System.Logger.Level.DEBUG)) {
286286
Log.error("Error when fully closing connection [" + fullDescription() + "]", ex);

0 commit comments

Comments
 (0)