You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2016/04/15 11:57:26 UTC
[37/50] incubator-tinkerpop git commit: Fix TINKERPOP-1252
Fix TINKERPOP-1252
It is now ensured that if there was any problem committing or rolling
back a transaction then the ThreadLocal binding to a Neo4j transaction
will be cleared.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/f56e597d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/f56e597d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/f56e597d
Branch: refs/heads/TINKERPOP-1179
Commit: f56e597dd9fc061a26da9319f67674e77c2de810
Parents: e859bb5
Author: Geoff Reedy <ge...@programmer-monk.net>
Authored: Wed Apr 6 22:02:12 2016 -0600
Committer: Geoff Reedy <ge...@programmer-monk.net>
Committed: Thu Apr 7 18:27:32 2016 +0000
----------------------------------------------------------------------
.../tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/f56e597d/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java
index 010e592..6f896af 100644
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java
@@ -332,24 +332,22 @@ public final class Neo4jGraph implements Graph, WrappedGraph<Neo4jGraphAPI> {
@Override
public void doCommit() throws TransactionException {
- try {
- threadLocalTx.get().success();
+ try (Neo4jTx tx = threadLocalTx.get()) {
+ tx.success();
} catch (Exception ex) {
throw new TransactionException(ex);
} finally {
- threadLocalTx.get().close();
threadLocalTx.remove();
}
}
@Override
public void doRollback() throws TransactionException {
- try {
- threadLocalTx.get().failure();
+ try (Neo4jTx tx = threadLocalTx.get()) {
+ tx.failure();
} catch (Exception e) {
throw new TransactionException(e);
} finally {
- threadLocalTx.get().close();
threadLocalTx.remove();
}
}