Package org.neo4j.graphdb

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


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


        }
      }

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

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

      log.debug( "Creating missing constraints" );
      Transaction tx = null;
      try {
        tx = neo4jDb.beginTx();
        addUniqueConstraints( neo4jDb, configuration );
        tx.success();
      }
      finally {
        tx.close();
      }
    }
View Full Code Here

        Transaction tx = gdb.beginTx();
        final Node node = index.get("id", info.getId()).getSingle();
        assertNotNull(node);
        assertEquals(info.getId(), node.getProperty("id"));
        assertEquals(info.getVersion(),node.getProperty("version"));
        tx.success();tx.close();
    }

    @Test
    public void testCreateWithNoRoot() throws Exception {
        final GraphInfo info = storage.create(new GraphInfo(Util.randomId(), "init", "query", "message","version",true));
View Full Code Here

        final Node node = index.get("id", info.getId()).getSingle();
        assertNotNull(node);
        assertEquals(info.getId(), node.getProperty("id"));
        assertEquals(info.getVersion(),node.getProperty("version"));
        assertEquals(!info.hasRoot(),(Boolean)node.getProperty("no_root"));
        tx.success();tx.close();
    }

    @Test
    public void testCreateWithNullId() throws Exception {
        final GraphInfo info = storage.create(new GraphInfo(null, "init", "query", "message"));
View Full Code Here

        Transaction tx = gdb.beginTx();
        assertNotNull(info.getId());
        final Node node = index.get("id", info.getId()).getSingle();
        assertNotNull(node);
        assertEquals(info.getId(), node.getProperty("id"));
        tx.success();tx.close();
    }

    @Test
    public void testCreateWithEmptyId() throws Exception {
        final String id = " ";
View Full Code Here

        assertFalse(info.getId().trim().isEmpty());
        final Node node = index.get("id", info.getId()).getSingle();
        assertNull(index.get("id", id).getSingle());
        assertNotNull(node);
        assertEquals(info.getId(), node.getProperty("id"));
        tx.success();tx.close();
    }

    @Test
    public void testCreateWithIdWithSpace() throws Exception {
        final String id = "";
View Full Code Here

        assertFalse(info.getId().trim().isEmpty());
        final Node node = index.get("id", info.getId()).getSingle();
        assertNull(index.get("id", id).getSingle());
        assertNotNull(node);
        assertEquals(info.getId(), node.getProperty("id"));
        tx.success();tx.close();
    }

    private void delete(Node node) {
        final Transaction tx = gdb.beginTx();
        node.delete();
View Full Code Here

    }

    private void delete(Node node) {
        final Transaction tx = gdb.beginTx();
        node.delete();
        tx.success();tx.close();
    }

    @Test
    public void testCreate() throws Exception {
        final GraphInfo info = storage.create(new GraphInfo("id", "init", "query", "message"));
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.