tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spmalle...@apache.org
Subject incubator-tinkerpop git commit: Check for open transactions before doing an auto commit/rollback.
Date Wed, 16 Dec 2015 16:31:41 GMT
Repository: incubator-tinkerpop
Updated Branches:
  refs/heads/TINKERPOP-1035 0b9556d8e -> f34bde7a9


Check for open transactions before doing an auto commit/rollback.

By adding this check Gremlin Server only commits/rollsback at the start of a request or at
the error driven end of a request. This should prevent graphs from creating extra transactions
when they are not needed (which might be expensive to do for some graphs).


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

Branch: refs/heads/TINKERPOP-1035
Commit: f34bde7a98b98f013f9bface26fe449197aece0d
Parents: 0b9556d
Author: Stephen Mallette <spmva@genoprime.com>
Authored: Wed Dec 16 11:29:09 2015 -0500
Committer: Stephen Mallette <spmva@genoprime.com>
Committed: Wed Dec 16 11:29:09 2015 -0500

----------------------------------------------------------------------
 .../java/org/apache/tinkerpop/gremlin/server/GraphManager.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/f34bde7a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GraphManager.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GraphManager.java
b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GraphManager.java
index 778e87a..b28493e 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GraphManager.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GraphManager.java
@@ -100,7 +100,7 @@ public final class GraphManager {
     public void rollbackAll() {
         graphs.entrySet().forEach(e -> {
             final Graph graph = e.getValue();
-            if (graph.features().graph().supportsTransactions())
+            if (graph.features().graph().supportsTransactions() && graph.tx().isOpen())
                 graph.tx().rollback();
         });
     }
@@ -118,7 +118,7 @@ public final class GraphManager {
     public void commitAll() {
         graphs.entrySet().forEach(e -> {
             final Graph graph = e.getValue();
-            if (graph.features().graph().supportsTransactions())
+            if (graph.features().graph().supportsTransactions() && graph.tx().isOpen())
                 graph.tx().commit();
         });
     }
@@ -148,7 +148,7 @@ public final class GraphManager {
         });
 
         graphsToCloseTxOn.forEach(graph -> {
-            if (graph.features().graph().supportsTransactions()) {
+            if (graph.features().graph().supportsTransactions() && graph.tx().isOpen())
{
                 if (tx == Transaction.Status.COMMIT)
                     graph.tx().commit();
                 else


Mime
View raw message