Package org.neo4j.graphdb

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


            tx.failure();
        } catch (IOException e) {
            System.err.println(e);
            tx.failure();
        } finally {
            tx.finish();
        }
    }


}
View Full Code Here


           x.createRelationshipTo(y, rt);
           tx.success();    
       } catch (Exception ex){
           System.out.println(ex.getMessage());
       } finally {
           tx.finish();
      
   }
     
   
   private void clearDb(){
View Full Code Here

            }
            tx.success();      
        } catch (Exception ex){
            System.out.println("createUpdateIndexNode:" + ex.getMessage());           
        } finally {
            tx.finish();
        }
        return node;
    }
   
     private Node createNotIndexNode(){                  
View Full Code Here

            node = graphDb.createNode();                                           
            tx.success();      
        } catch (Exception ex){
            System.out.println("createNotIndexNode:" + ex.getMessage());           
        } finally {
            tx.finish();
        }
        return node;
    }
    
     private void deleteNode(Node node){
View Full Code Here

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

            rel.delete();           
            tx.success();      
        } catch (Exception ex){
            System.out.println(ex.getMessage());           
        } finally {
            tx.finish();
        }
     }
   
    public void startJSONArray(JSONArray array){
        for(int i=0; i<array.length();i++){
View Full Code Here

    // Finalize transaction
    // If success() method isn't call (it's our case because we only
    // perforrm read operations) the transaction is rolledback on finish()
    // method invocation...
    transaction.finish();
  }

  /**
   * Create a new node and set a property representing the member name.<br>
   * All operations that work with the graph (be it read or write operations)
View Full Code Here

      // Mark the transaction as failed
      tx.failure();
      throw e;
    } finally {
      // Mark the transactin as ended
      tx.finish();
    }
    return newNode;
  }

  /**
 
View Full Code Here

      // Mark the transaction as failed
      tx.failure();
      throw e;
    } finally {
      // Mark the transactin as ended
      tx.finish();
    }
    return newRelationship;
  }

  /**
 
View Full Code Here

    {
        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" ) );
        assertNotNull( map.get( "node_index" ) );
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.