You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by ok...@apache.org on 2016/01/05 23:54:48 UTC

[16/50] incubator-tinkerpop git commit: TINKERPOP3-1062 Move beforeEval to occur in same thread as eval

TINKERPOP3-1062 Move beforeEval to occur in same thread as eval

In this way, beforeEval can working with ThreadLocal settings on the Graph instances (as it may pertain to transactions).


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

Branch: refs/heads/TINKERPOP-1033
Commit: d85a35d8741a5e534c0c45b194a716de10803198
Parents: 114d867
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Dec 22 08:58:58 2015 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Dec 22 08:58:58 2015 -0500

----------------------------------------------------------------------
 .../apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/d85a35d8/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java
index f213d0d..49e2ac7 100644
--- a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java
+++ b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java
@@ -247,11 +247,12 @@ public class GremlinExecutor implements AutoCloseable {
         final Bindings bindings = new SimpleBindings();
         bindings.putAll(globalBindings);
         bindings.putAll(boundVars);
-        lifeCycle.getBeforeEval().orElse(beforeEval).accept(bindings);
 
         final CompletableFuture<Object> evaluationFuture = new CompletableFuture<>();
         final FutureTask<Void> f = new FutureTask<>(() -> {
             try {
+                lifeCycle.getBeforeEval().orElse(beforeEval).accept(bindings);
+
                 logger.debug("Evaluating script - {} - in thread [{}]", script, Thread.currentThread().getName());
 
                 final Object o = scriptEngines.eval(script, bindings, lang);