changeset 33:86bb29132ba6

add transaction.
author casties
date Tue, 25 Sep 2012 22:14:06 +0200
parents 0731c4549065
children 8427930c5f88
files src/main/java/de/mpiwg/itgroup/annotations/neo4j/AnnotationStore.java
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/java/de/mpiwg/itgroup/annotations/neo4j/AnnotationStore.java	Tue Sep 25 21:59:21 2012 +0200
+++ b/src/main/java/de/mpiwg/itgroup/annotations/neo4j/AnnotationStore.java	Tue Sep 25 22:14:06 2012 +0200
@@ -842,7 +842,13 @@
             Node oldActorNode = rel.getEndNode();
             if (!oldActorNode.equals(newActorNode)) {
                 // new admin is different
-                rel.delete();
+                Transaction tx = graphDb.beginTx();
+                try {
+                    rel.delete();
+                    tx.success();
+                } finally {
+                    tx.finish();
+                }
                 if (newActorNode != null) {
                     rel = getOrCreateRelation(annotNode, type, newActorNode);
                 }