Package org.neo4j.graphdb

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


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

    public void transaction(Trx trx) {
        Transaction trans = db.beginTx();
        try {
            trx.execute(db);
            trans.success();
        } catch (RuntimeException e) {
            throw e;
        } catch (Exception e) {
            log.error("Transaction failed", e);
            throw new RuntimeException(e);
View Full Code Here

    protected void manualCleanDb() {
    Transaction tx = graphDatabaseService.beginTx();
    try {
      cleanDb();
      tx.success();
    } finally {
      tx.close();
    }
  }
View Full Code Here

        NodeManager nodeManager = graphDatabase.getDependencyResolver().resolveDependency(NodeManager.class);
        PropertyContainer properties = nodeManager.getGraphProperties();
        Transaction transaction = graphDatabase.beginTx();
        properties.setProperty("any other property", "should be ignored");
        transaction.success();
        transaction.finish();

        assertEquals(genericMap("user1", RO), service.getUsers());

        service.setPermissionForUser("user2", RW);
View Full Code Here

        try {
            PropertyContainer properties = getGraphProperties();
            String userKey = getUserKey(cred);
            Object result = properties.getProperty(userKey, "");
            String credentials = (result instanceof Boolean) ? "" : (String) result;
            tx.success();
            return credentials;
        } finally {
            tx.finish();
        }
    }
View Full Code Here

            if (permission == Permission.NONE) {
                properties.removeProperty(key);
            } else {
                properties.setProperty(key, permission.name());
            }
            transaction.success();
        } catch (Exception e) {
            transaction.failure();
        } finally {
            transaction.finish();
        }
View Full Code Here

            ix.add(n, "pr", pr);
          }
        }
        if (cnt++%10000==0){
          System.out.println(cnt);
          tx.success();
          tx.finish();
          tx = graphDB.beginTx();
        }
      }
      tx.success();
View Full Code Here

          tx.success();
          tx.finish();
          tx = graphDB.beginTx();
        }
      }
      tx.success();
    }catch (Exception e){
      e.printStackTrace();
    }finally{
      tx.finish();
    }
View Full Code Here

    Transaction tx = db.beginTx();
    try {
      for (Entry<Long, Double> e : nodeIndex.entrySet()) {
        cnt++;
        if (cnt > 50000){
          tx.success();
          tx.finish();
          cnt=0;
          tx = db.beginTx();
          IOHelper.log("updated another 50k nodes with PR properties");
        }
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.