Package org.neo4j.graphdb

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


            rawGraphDB = builder.newGraphDatabase();
            Transaction tx = rawGraphDB.beginTx();

            try {
                rawGraphDB.getReferenceNode().delete();
                tx.success();
            } catch (Exception e) {
                tx.failure();
            } finally {
                tx.finish();
            }
View Full Code Here


                if (!pc.hasProperty(property)) continue;
                pc.setProperty(property, pc.getProperty(property));
                count++;
                if (count >= 10000) {
                    count = 0;
                    tx.success();
                    tx.finish();
                    tx = rawGraphDB.beginTx();
                }
            }
        }
View Full Code Here

                    tx.finish();
                    tx = rawGraphDB.beginTx();
                }
            }
        }
        tx.success();
        tx.finish();
    }

    public String toString() {
        return StringFactory.graphString(this, this.rawGraph.toString());
View Full Code Here

                Node niclas = database.createNode();
                niclas.setProperty( "name", "Niclas" );

                rickard.createRelationshipTo( niclas, TestRelationships.KNOWS );

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

        Transaction tx = graphDb.beginTx();

        optimize(wayId, roadPartsToMerge);

        tx.success();
        tx.finish();

    }

    private void optimize(Long wayId, List<List<Relationship>> roadPartsToMerge) {
View Full Code Here

            XMLReader xmlReader = XMLReaderFactory.createXMLReader();
            xmlReader.setContentHandler(new MainOSMHandler(xmlReader, graphDb));
            xmlReader.parse(xml);

            // Hallelujah
            tx.success();

        } catch (SAXException e) {
            System.err.println(e);
            tx.failure();
        } catch (IOException e) {
View Full Code Here

  
   private void makeRelationship(Node x, Node y, RelationshipType rt){
       Transaction tx = graphDb.beginTx();
       try{
           x.createRelationshipTo(y, rt);
           tx.success();    
       } catch (Exception ex){
           System.out.println(ex.getMessage());
       } finally {
           tx.finish();
      
View Full Code Here

                Object value = entry.getValue();
                if(value!=JSONObject.NULL && key!=JSONObject.NULL) {
                    node.setProperty(key, value);
                }               
            }
            tx.success();      
        } catch (Exception ex){
            System.out.println("createUpdateIndexNode:" + ex.getMessage());           
        } finally {
            tx.finish();
        }
View Full Code Here

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

    
     private void deleteNode(Node node){
        Transaction tx = graphDb.beginTx();
        try {           
            node.delete();           
            tx.success();      
        } catch (Exception ex){
            System.out.println(ex.getMessage());           
        } 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.