Examples of success()


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

    public void setEditable(boolean editable) {
        Transaction tx = db.beginTx();
        try {
            node.setProperty("editable",Boolean.valueOf(editable));
            tx.success();
        } finally {
            tx.finish();
        }
    }
}
View Full Code Here

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

        Label label = DynamicLabel.label( generatorKey );
        if ( isMissingUniqueConstraint( neo4jDb, label, SEQUENCE_NAME_PROPERTY ) ) {
          neo4jDb.schema().constraintFor( label ).assertPropertyIsUnique( SEQUENCE_NAME_PROPERTY ).create();
        }
      }
      tx.success();
    }
    finally {
      tx.close();
    }
  }
View Full Code Here

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

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

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

    try {
      tx = neo4jDb.beginTx();
      for ( IdentifierGenerator identifierGenerator : identifierGenerators ) {
        addUniqueConstraint( identifierGenerator );
      }
      tx.success();
    }
    finally {
      tx.close();
    }
  }
View Full Code Here

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

    try {
      tx = neo4jDb.beginTx();
      for ( IdentifierGenerator generator : identifierGenerators ) {
        addSequence( generator );
      }
      tx.success();
    }
    finally {
      tx.close();
    }
  }
View Full Code Here

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

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

            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

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

                    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

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

                    }
                } 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

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

  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
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.