You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by jh...@apache.org on 2016/09/28 23:54:18 UTC

calcite git commit: [CALCITE-1361] Remove entry from AvaticaConnection.flagMap when session closed

Repository: calcite
Updated Branches:
  refs/heads/master c9ec5c88d -> fb6c24adc


[CALCITE-1361] Remove entry from AvaticaConnection.flagMap when session closed


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

Branch: refs/heads/master
Commit: fb6c24adcc49ca83ee92af325a2664475cc00ebc
Parents: c9ec5c8
Author: Julian Hyde <jh...@apache.org>
Authored: Thu Aug 25 08:13:53 2016 -0700
Committer: Julian Hyde <jh...@apache.org>
Committed: Wed Sep 28 14:47:46 2016 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/calcite/avatica/AvaticaConnection.java    | 2 +-
 .../src/main/java/org/apache/calcite/avatica/AvaticaStatement.java | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/calcite/blob/fb6c24ad/avatica/core/src/main/java/org/apache/calcite/avatica/AvaticaConnection.java
----------------------------------------------------------------------
diff --git a/avatica/core/src/main/java/org/apache/calcite/avatica/AvaticaConnection.java b/avatica/core/src/main/java/org/apache/calcite/avatica/AvaticaConnection.java
index 66a9419..51649c1 100644
--- a/avatica/core/src/main/java/org/apache/calcite/avatica/AvaticaConnection.java
+++ b/avatica/core/src/main/java/org/apache/calcite/avatica/AvaticaConnection.java
@@ -91,7 +91,7 @@ public abstract class AvaticaConnection implements Connection {
   public final Map<InternalProperty, Object> properties = new HashMap<>();
   public final Map<Integer, AvaticaStatement> statementMap =
       new ConcurrentHashMap<>();
-  private final Map<Integer, AtomicBoolean> flagMap = new HashMap<>();
+  final Map<Integer, AtomicBoolean> flagMap = new ConcurrentHashMap<>();
   protected final long maxRetriesPerExecute;
 
   /**

http://git-wip-us.apache.org/repos/asf/calcite/blob/fb6c24ad/avatica/core/src/main/java/org/apache/calcite/avatica/AvaticaStatement.java
----------------------------------------------------------------------
diff --git a/avatica/core/src/main/java/org/apache/calcite/avatica/AvaticaStatement.java b/avatica/core/src/main/java/org/apache/calcite/avatica/AvaticaStatement.java
index f7ba051..2900229 100644
--- a/avatica/core/src/main/java/org/apache/calcite/avatica/AvaticaStatement.java
+++ b/avatica/core/src/main/java/org/apache/calcite/avatica/AvaticaStatement.java
@@ -182,6 +182,7 @@ public abstract class AvaticaStatement
   protected void resetStatement() {
     // Invalidate the old statement
     connection.statementMap.remove(handle.id);
+    connection.flagMap.remove(handle.id);
     // Get a new one
     final Meta.ConnectionHandle ch = new Meta.ConnectionHandle(connection.id);
     Meta.StatementHandle h = connection.meta.createStatement(ch);
@@ -258,6 +259,7 @@ public abstract class AvaticaStatement
       } finally {
         // make sure we don't leak on our side
         connection.statementMap.remove(handle.id);
+        connection.flagMap.remove(handle.id);
       }
       // If onStatementClose throws, this method will throw an exception (later
       // converted to SQLException), but this statement still gets closed.