Package org.neo4j.graphdb

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


    public void setUp() throws Throwable {
        serverGraphDatabase.cleanContent();
        final Transaction tx = serverGraphDatabase.beginTx();
        remoteNode = serverGraphDatabase.createNode();
        remoteNode.setProperty(NAME, VALUE);
        tx.success();tx.close();

        consoleService = new ConsoleService();
        service = new Neo4jService();
    }
}
View Full Code Here


            ExecutionResult result = canProfile ? executionEngine.profile(query,params) : executionEngine.execute(query,params);
            final Collection<Map<String, Object>> data = IteratorUtil.asCollection(result);
            time = System.currentTimeMillis() - time;
            resumeTransaction(resumeTx);
            CypherResult cypherResult = new CypherResult(result.columns(), data, result.getQueryStatistics(), time, canProfile ? result.executionPlanDescription() : null, prettify(query));
            tx.success();
            return cypherResult;
        } finally {
            tx.close();
            awaitIndexOnline(query);
        }
View Full Code Here

        relationshipAutoIndexer = gdb.index().getRelationshipAutoIndexer();
        enableAutoIndex(nodeAutoIndexer);
        enableAutoIndex(relationshipAutoIndexer);
        autoIndexedProperties.addAll(nodeAutoIndexer.getAutoIndexedProperties());
        autoIndexedProperties.addAll(relationshipAutoIndexer.getAutoIndexedProperties());
        tx.success();tx.close();
    }

    private void enableAutoIndex(AutoIndexer<? extends PropertyContainer> autoIndexer) {
        autoIndexer.setEnabled(true);
        //autoIndexer.getAutoIndex();
View Full Code Here

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

            for(FlatColor color : swatches) {
                sb.append(Integer.toHexString(color.getRGBA()));
                sb.append(",");
            }
            this.node.setProperty("colors",sb.toString());
            tx.success();
        } finally {
            tx.finish();
        }
    }
View Full Code Here

    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

        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

    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

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

    try {
      tx = neo4jDb.beginTx();
      for ( IdentifierGenerator generator : identifierGenerators ) {
        addSequence( generator );
      }
      tx.success();
    }
    finally {
      tx.close();
    }
  }
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.