Package org.neo4j.kernel

Examples of org.neo4j.kernel.EmbeddedGraphDatabase.beginTx()


    displayRelationship(r05);

    /* Perform selections on the graph database */
    System.out.println("\n*** MEMBERS RELATIONSHIPS SELECTION ***");
    // Use a transaction for selections because it's required by Neo4J...
    Transaction transaction = graphDatabase.beginTx();

    // Find a node according to a property value (search for Tony member)
    System.out.println("** Find a node according to a property value (search for Tony member)");
    Iterable<Node> members = graphDatabase.getAllNodes();
    long tonyId = -1;
View Full Code Here


      return;
    }
   
    EmbeddedGraphDatabase graphDB = ContextHelper.getGraphDatabase(servletContext);

    Transaction tx = graphDB.beginTx();
    try{
      userNode.setProperty(DBNodeProperties.USER_EMAIL, email);
      userNode.setProperty(DBNodeProperties.USER_PW_HASH, passwordHash);
      userNode.setProperty(DBNodeProperties.USER_NAME, username);
      userNode.setProperty(DBNodeProperties.USER_SESSIONS, sessionList.toArray(new String[sessionList.size()]));
View Full Code Here

    IOHelper.log("Creating new user");
    print();
   
    EmbeddedGraphDatabase graphDB = ContextHelper.getGraphDatabase(servletContext);
   
    Transaction tx = graphDB.beginTx();
    try{
      userNode = graphDB.createNode();
      save();
     
      tx.success();
View Full Code Here

  }
 
  private void deleteUser() {
    EmbeddedGraphDatabase graphDB = ContextHelper.getGraphDatabase(servletContext);
   
    Transaction tx = graphDB.beginTx();
    try{
      userNode.setProperty(DBNodeProperties.USER_DELETED, true);
      tx.success();
    } catch (Exception e){
      tx.failure();
View Full Code Here

  public static void main(String[] args) {
    System.out.println("Hello Neo4j!");
//    GraphDatabaseService graphDb = new EmbeddedGraphDatabase( "target/data/test" );
    GraphDatabaseService graphDb = new EmbeddedGraphDatabase( "/Users/trisberg/neo4j/imdb" );
    Transaction tx = graphDb.beginTx();

    tx = graphDb.beginTx();
    try {
      for (Node n : graphDb.getAllNodes()) {
        System.out.print("=> " + n.getId() + " :: ");
View Full Code Here

    System.out.println("Hello Neo4j!");
//    GraphDatabaseService graphDb = new EmbeddedGraphDatabase( "target/data/test" );
    GraphDatabaseService graphDb = new EmbeddedGraphDatabase( "/Users/trisberg/neo4j/imdb" );
    Transaction tx = graphDb.beginTx();

    tx = graphDb.beginTx();
    try {
      for (Node n : graphDb.getAllNodes()) {
        System.out.print("=> " + n.getId() + " :: ");
        for (String s : n.getPropertyKeys()) {
          System.out.print(" : " + s + " = " + n.getProperty(s));
View Full Code Here

    public void inabilityToStartFromOldFormatFromNonCleanShutdown() throws Exception
    {
        String storeDir = "target/var/oldlog";
        deleteFileOrDirectory( storeDir );
        GraphDatabaseService db = new EmbeddedGraphDatabase( storeDir );
        Transaction tx = db.beginTx();
        db.createNode();
        tx.success();
        tx.finish();
       
        Pair<Pair<File, File>, Pair<File, File>> copy = copyLogicalLog( storeDir );
View Full Code Here

        System.out.println( "Switch to embedded" );
       
        // Then create the rest with embedded graph db.
        GraphDatabaseService db = new EmbeddedGraphDatabase( PATH );
        Node firstNode = db.getNodeById( first );
        Transaction tx = db.beginTx();
        for ( ; i < 5000000000L; i++ )
        {
            Node secondNode = db.createNode();
            firstNode.createRelationshipTo( secondNode, TYPE );
            firstNode = secondNode;
View Full Code Here

            if ( i % 100000 == 0 )
            {
                tx.success();
                tx.finish();
                System.out.println( (i/1000000) + "M" );
                tx = db.beginTx();
            }
        }
       
        // Here we have a huge db. Loop through it and count chain length.
/*        long count = 0;
View Full Code Here

   
    private DbRepresentation createSomeData()
    {
        DynamicRelationshipType type = withName( "KNOWS" );
        GraphDatabaseService db = new EmbeddedGraphDatabase( PATH );
        Transaction tx = db.beginTx();
        Node prevNode = db.getReferenceNode();
        for ( int i = 0; i < 100; i++ )
        {
            Node node = db.createNode();
            Relationship rel = prevNode.createRelationshipTo( node, type );
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.