Package org.neo4j.graphdb

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


    
     private void deleteRelationship(Relationship rel){
        Transaction tx = graphDb.beginTx();
        try {           
            rel.delete();           
            tx.success();      
        } catch (Exception ex){
            System.out.println(ex.getMessage());           
        } finally {
            tx.finish();
        }
View Full Code Here


        newNode = graphDb.createNode();
        // Set a property on the node representing the member name
        newNode.setProperty("MemberName", memberName);
      }
      // Mark the transaction as succeed
      tx.success();
    } catch (Exception e) {
      // Mark the transaction as failed
      tx.failure();
      throw e;
    } finally {
View Full Code Here

      // target node if the relationships do not already exists in the DB
      if (newRelationship == null) {
        newRelationship = ownerNode.createRelationshipTo(counterpartNode, relationshipType);
      }
      // Mark the transaction as succeed
      tx.success();
    } catch (Exception e) {
      // Mark the transaction as failed
      tx.failure();
      throw e;
    } finally {
View Full Code Here

    public void assert200OkFromGet() throws Exception
    {
        AbstractGraphDatabase db = (AbstractGraphDatabase)graphdb();
        Transaction tx = db.beginTx();
        db.getConfig().getGraphDbModule().setReferenceNodeId( data.get().get("I").getId() );
        tx.success();
        tx.finish();
        String body = gen.get().expectedStatus( 200 ).get( getDataUri() ).entity();
        Map<String, Object> map = JsonHelper.jsonToMap( body );
        assertEquals( getDataUri() + "node", map.get( "node" ) );
        assertNotNull( map.get( "reference_node" ) );
View Full Code Here

        Transaction tx = graphDb.beginTx();

        try
        {
            unitOfWork.doWork();
            tx.success();
        }
        finally
        {
            tx.finish();
        }
View Full Code Here

      Relationship metadataNodeRelationship = getRootNode().getSingleRelationship(RTreeRelationshipTypes.RTREE_METADATA, Direction.OUTGOING);
      Node metadataNode = metadataNodeRelationship.getEndNode();
      metadataNodeRelationship.delete();
      metadataNode.delete();
   
      tx.success();
    } finally {
      tx.finish();
    }   
   
    countSaved = false;
View Full Code Here

      try {
        for (Relationship rel : indexNode.getRelationships(RTreeRelationshipTypes.RTREE_REFERENCE, Direction.OUTGOING)) {
          visitor.onIndexReference(rel.getEndNode());
        }
     
        tx.success();
      } finally {
        tx.finish();
      }
    }
  }
View Full Code Here

    if (!countSaved) {
      Transaction tx = database.beginTx();
      try {
        getMetadataNode().setProperty("totalGeometryCount", totalGeometryCount);
        countSaved = true;
        tx.success();
      } finally {
        tx.finish();
      }
    }
  } 
View Full Code Here

            this.treeName = treeName;
        this.isUniqueIndex = isUniqueIndex;
            this.nodeComparator = nodeComparator;

            tx.success();
        }
        finally
        {
            tx.finish();
        }
View Full Code Here

        Transaction tx = graphDatabaseContext.beginTx();
        try {
            ENTITY result = delegate.persist();

            flushDirty();
            tx.success();
            return result;
        } finally {
            tx.finish();
        }
    }
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.