Package org.neo4j.graphdb

Examples of org.neo4j.graphdb.Transaction.success()


    Lock lock = null;
    try {
      Node sequence = getSequence( rowKey );
      lock = tx.acquireWriteLock( sequence );
      int nextValue = updateSequenceValue( sequence, increment );
      tx.success();
      lock.release();
      return nextValue;
    }
    finally {
      tx.close();
View Full Code Here


            Node targetNode = getOrCreateNode(target, targetTypeName);
            getOrCreateRelationship(targetTypeNode, targetNode, Named.relation(REL_TYPE_ALL));

            getOrCreateRelationship(sourceNode, targetNode, Named.relation(type));

            tx.success();
        } catch(Exception e) {
            tx.failure();
            throw new RuntimeException(
                "Could not add relation of type " + type + " between " + source + " and " + target, e);
        } finally {
View Full Code Here

                    rel.delete();
                    relationIndex.remove(rel);
                }
            }

            tx.success();
        } catch(Exception e) {
            tx.failure();
            throw new RuntimeException(
                "Could not add relation of type " + type + " between " + source + " and " + target, e);
        } finally {
View Full Code Here

                    }
                } else {
                    targets.add(target);
                }
            }
            tx.success();
        } catch(Exception e) {
            tx.failure();
            throw new RuntimeException(
                "Could not clean up relation of type " + type + " from " + source, e);
        } finally {
View Full Code Here

  private Node getOrCreateSequence(RowKey key, final int initialValue) {
    Transaction tx = neo4jDb.beginTx();
    try {
      UniqueFactory<Node> factory = nodeFactory( initialValue );
      Node sequenceNode = factory.getOrCreate( ID_SEQUENCE_PROPERTY, generateId( key ) );
      tx.success();
      return sequenceNode;
    }
    finally {
      tx.finish();
    }
View Full Code Here

    Transaction tx = neo4jDb.beginTx();
    Lock lock = null;
    try {
      lock = tx.acquireWriteLock( sequence );
      int nextValue = updateSequenceValue( sequence, increment );
      tx.success();
      lock.release();
      return nextValue;
    }
    finally {
      tx.finish();
View Full Code Here

    public void setName(String name) {
        Transaction tx = db.beginTx();
        try {
            node.setProperty(AssetDB.NAME,name);
            tx.success();
        } finally {
            tx.finish();
        }
    }
View Full Code Here

      Object object) throws InterceptionException {
    Transaction tx = db.beginTx();
    try {
      stack.next(method, object);
      if(! validator.hasErrors()) {
        tx.success();
      } else {
        tx.failure();
      }
    } finally {
      tx.finish();
View Full Code Here

                    bTreeRel = underlyingNode.createRelationshipTo( bTreeNode,
                            BTree.RelTypes.TREE_ROOT );
                }
                indexBTree = new BTree( graphDb, bTreeRel.getEndNode() );
            }
            tx.success();
        }
        finally
        {
            tx.finish();
        }
View Full Code Here

                        firstNode = nodeToAdd;
                    }
                    updateNodeAdded( timestamp );
                }
            }
            tx.success();
        }
        finally
        {
            tx.finish();
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.