From 4a5bac97b53b56074818516306e1ea4904dad3f9 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Fri, 3 Apr 2020 21:13:53 +0200 Subject: [PATCH] Close-suppressing Connection proxy exposes target isClosed() state Closes gh-24853 --- .../jdbc/datasource/SingleConnectionDataSource.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/SingleConnectionDataSource.java b/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/SingleConnectionDataSource.java index b0914f41899c..23b35a2303af 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/SingleConnectionDataSource.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/SingleConnectionDataSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -322,7 +322,7 @@ else if (method.getName().equals("close")) { return null; } else if (method.getName().equals("isClosed")) { - return false; + return this.target.isClosed(); } else if (method.getName().equals("getTargetConnection")) { // Handle getTargetConnection method: return underlying Connection.