Package org.neo4j.graphdb

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


            thing.setName("thing");
            subThingNode = graphDatabaseContext.createNode();
            subThing = new SubThing(subThingNode);
            nodeTypeRepresentationStrategy.postEntityCreation(subThingNode, SubThing.class);
            subThing.setName("subThing");
            tx.success();
        } finally {
            tx.finish();
        }
    }
View Full Code Here


    private void checkNeo4jTransactionManager() {
        Transaction tx = null;
        try {
            tx = graphDatabaseContext.beginTx();
            updateStartTime();
            tx.success();
        } catch (Exception e) {
            AssertionError error = new AssertionError("transactionManager not correctly configured, please refer to the manual, setup section");
            error.initCause(e);
            throw error;
        } finally {
View Full Code Here

        Person p = persistedPerson("Michael", 35);
        Person spouse = persistedPerson("Tina", 36);
        p.setSpouse(spouse);
        long id = spouse.getId();
        graphDatabaseContext.removeNodeEntity(spouse);
        tx.success();
        tx.finish();
        Assert.assertNull("spouse removed " + p.getSpouse(), p.getSpouse());
        Person spouseFromIndex = personRepository.findByPropertyValue(Person.NAME_INDEX, "name", "Tina");
        Assert.assertNull("spouse not found in index",spouseFromIndex);
        Assert.assertNull("node deleted " + id, graphDatabaseContext.getNodeById(id));
View Full Code Here

        Person p = persistedPerson("Michael", 35);
        Person spouse = persistedPerson("Tina", 36);
        p.setSpouse(spouse);
        long id = spouse.getId();
        spouse.remove();
        tx.success();
        tx.finish();
        Assert.assertNull("spouse removed " + p.getSpouse(), p.getSpouse());
        Person spouseFromIndex = personRepository.findByPropertyValue(Person.NAME_INDEX, "name", "Tina");
        Assert.assertNull("spouse not found in index", spouseFromIndex);
        Assert.assertNull("node deleted " + id, graphDatabaseContext.getNodeById(id));
View Full Code Here

      thing = new Thing(node);
      noopNodeStrategy.postEntityCreation(node, Thing.class);
            Relationship rel = node.createRelationshipTo(graphDatabaseContext.createNode(), DynamicRelationshipType.withName("link"));
            link = new Link(rel);
            noopRelationshipStrategy.postEntityCreation(rel, Link.class);
      tx.success();
      return thing;
    } finally {
      tx.finish();
    }
  }
View Full Code Here

        Transaction tx = graphDatabaseService.beginTx();
        try
        {
            nodeTypeRepresentationStrategy.preEntityRemoval(node(thing));
            tx.success();
        }
        finally
        {
            tx.finish();
        }
View Full Code Here

    assertEquals(node(subThing), subThingHits.getSingle());

        tx = graphDatabaseService.beginTx();
        try {
            nodeTypeRepresentationStrategy.preEntityRemoval(node(subThing));
            tx.success();
        }
        finally
        {
            tx.finish();
        }
View Full Code Here

            thing.setName("thing");
            Node n2 = graphDatabaseService.createNode();
            subThing = new SubThing(n2);
      nodeTypeRepresentationStrategy.postEntityCreation(n2, SubThing.class);
            subThing.setName("subThing");
      tx.success();
      return thing;
    } finally {
      tx.finish();
    }
  }
View Full Code Here

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

        Map<String, Object> result = new HashMap<String, Object>();
        Transaction tx = graph.beginTx();
        try {
            removeNodes(result);
            clearIndex(result);
            tx.success();
        } finally {
            tx.finish();
        }
        return result;
    }
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.