tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andygumbre...@apache.org
Subject tomee git commit: https://issues.apache.org/jira/browse/TOMEE-1860 _closed state must be set and null check is required in isClose
Date Mon, 11 Jul 2016 21:53:35 GMT
Repository: tomee
Updated Branches:
  refs/heads/tomee-1.7.x f5519507e -> f7c17bf48


https://issues.apache.org/jira/browse/TOMEE-1860
_closed state must be set and null check is required in isClose


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/f7c17bf4
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/f7c17bf4
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/f7c17bf4

Branch: refs/heads/tomee-1.7.x
Commit: f7c17bf481ac899e4f6ec60dbe5e99613850a1bb
Parents: f551950
Author: AndyGee <andy.is@gmx.de>
Authored: Mon Jul 11 23:53:17 2016 +0200
Committer: AndyGee <andy.is@gmx.de>
Committed: Mon Jul 11 23:53:17 2016 +0200

----------------------------------------------------------------------
 .../resource/jdbc/dbcp/BasicManagedDataSource.java  | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/f7c17bf4/container/openejb-core/src/main/java/org/apache/openejb/resource/jdbc/dbcp/BasicManagedDataSource.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/resource/jdbc/dbcp/BasicManagedDataSource.java
b/container/openejb-core/src/main/java/org/apache/openejb/resource/jdbc/dbcp/BasicManagedDataSource.java
index 841e898..c9454c1 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/resource/jdbc/dbcp/BasicManagedDataSource.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/resource/jdbc/dbcp/BasicManagedDataSource.java
@@ -98,10 +98,20 @@ public class BasicManagedDataSource extends org.apache.commons.dbcp.managed.Basi
                 return new ManagedConnection(connectionPool, transactionRegistry, isAccessToUnderlyingConnectionAllowed())
{
                     @Override
                     public void close() throws SQLException {
-                        if (getDelegateInternal() == null) {
-                            return;
+                        if (!_closed) {
+                            try {
+                                if (null != getDelegateInternal()) {
+                                    super.close();
+                                }
+                            } finally {
+                                _closed = true;
+                            }
                         }
-                        super.close();
+                    }
+
+                    @Override
+                    public boolean isClosed() throws SQLException {
+                        return _closed || null != _conn && _conn.isClosed();
                     }
                 };
             }


Mime
View raw message