Package org.neo4j.graphdb

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


          }
        }
        if (cnt++%10000==0){
          System.out.println(cnt);
          tx.success();
          tx.finish();
          tx = graphDB.beginTx();
        }
      }
      tx.success();
    }catch (Exception e){
View Full Code Here


      }
      tx.success();
    }catch (Exception e){
      e.printStackTrace();
    }finally{
      tx.finish();
    }
  }
 
  public void getNodesWithHighPageRank(){
    Index<Node> ix = graphDB.index().forNodes("pageRank");
View Full Code Here

    try {
      for (Entry<Long, Double> e : nodeIndex.entrySet()) {
        cnt++;
        if (cnt > 50000){
          tx.success();
          tx.finish();
          cnt=0;
          tx = db.beginTx();
          IOHelper.log("updated another 50k nodes with PR properties");
        }
        Node n = db.getNodeById(e.getKey());
View Full Code Here

        Node n = db.getNodeById(e.getKey());
        n.setProperty("pageRankValue", e.getValue());
      }
      tx.success();
    } finally {
      tx.finish();
    }
  }

  private HashMap<Long, Double> getNodesToIndex() {
    HashMap<Long, Double> nodeIndex = new HashMap<Long, Double>();
View Full Code Here

   
    // DynamicRelationshipType testType = DynamicRelationshipType.withName("test");
    // node1.createRelationshipTo(node2, testType);
   
    tx.success();
    tx.finish();
   
  }

 
  public static void main(String[] args) {
View Full Code Here

          if (topkCnt>=k)break;         
       
        if (++transactionCount % transactionThreshhold == 0){
          tx.success();
          tx.finish();
          tx = graphDB.beginTx();
          IOHelper.log(transactionCount + " nodes have been attached with coAuthorshiprelations so far");     
        }
//        IOHelper.log(log);
View Full Code Here

//        System.out.println(" ");
      }
      tx.success();
    }finally{
      tx.finish();
    }
  }
 
 
  public void calculateCoAuthors(int transactionThreshhold){
View Full Code Here

          Relationship coAuthorRel = author.createRelationshipTo(coAuthor, DBRelationshipTypes.CO_AUTHOR_COUNT);
          coAuthorRel.setProperty(DBRelationshipProperties.CO_AUTHOR_COUNT,coAuthors.get(coAuthor));
         
          if (++transactionCount % transactionThreshhold == 0){
            tx.success();
            tx.finish();
            tx = graphDB.beginTx();
            IOHelper.log(transactionCount + " coAuthor relations have been inserted so far");
            System.out.println("current relation's count is " + coAuthors.get(coAuthor))
          }         
        }     
View Full Code Here

          }         
        }     
      }
      tx.success();
    }finally{
      tx.finish();
    }
  }
 
 
  public void calculateLikesToCiteAuthors(int transactionThreshhold){
View Full Code Here

          Relationship coAuthorRel = author.createRelationshipTo(citedAuthor, DBRelationshipTypes.CITES_AUTHOR);
          coAuthorRel.setProperty(DBRelationshipProperties.CITATION_COUNT,citedAuthors.get(citedAuthor));
         
          if (++transactionCount % transactionThreshhold == 0){
            tx.success();
            tx.finish();
            tx = graphDB.beginTx();
            IOHelper.log(transactionCount + " citedAuthor relations have been inserted so far");
            System.out.println("current relation's count is " + citedAuthors.get(citedAuthor));     
          }         
        }     
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.