[Neo] Node not found using BatchInserter

Mattias Persson mattias at neotechnology.com
Thu Apr 1 08:32:16 CEST 2010


rel_itr.next() returns relationship ids, not node ids... that's why you get
those NotFoundExceptions. What you'd need to do is to
inserter.getRelationshipById( <rel-id> ) on those ids and get either start
or end node from it.

But, is it really right to use the batch inserter in your case?
BatchInserter is only meant to be used if you're doing a one-time initial
loading of a big dataset, but never in production or when you have a
database containing data. Use the EmbeddedGraphDatabase for normal use.

2010/3/31 Amir Hossein Jadidinejad <amir.jadidi at yahoo.com>

> Hi,
> Check the following code:
>             for (Iterator<Long> rel_itr =
> inserter.getRelationshipIds(current_node).iterator(); rel_itr.hasNext();) {
>                 long neighbor = rel_itr.next();
>                 if (neighbor != current_node && neighbor != -1) {
>                     try {
>
> exist_neighbors.add(inserter.getNodeProperties(neighbor).get("cui").toString());
>                     } catch (Exception e) {
>                         e.printStackTrace();
>                     }
>                 }
>             }
>
> After running, I have a lot of this error:
> org.neo4j.graphdb.NotFoundException: id=3225225
>     at
> org.neo4j.kernel.impl.batchinsert.BatchInserterImpl.getNodeRecord(BatchInserterImpl.java:517)
>     at
> org.neo4j.kernel.impl.batchinsert.BatchInserterImpl.getNodeProperties(BatchInserterImpl.java:238)
>     at org.qiau.wnng.build.BuildGraph.addAllNodes(BuildGraph.java:220)
>     at org.qiau.wnng.build.BuildGraph.main(BuildGraph.java:288)
>
> Is it possible that a neighbor node not found while "getRelationshipIds"
> method return it?!
>
>
>
>
> _______________________________________________
> Neo mailing list
> User at lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>



-- 
Mattias Persson, [mattias at neotechnology.com]
Hacker, Neo Technology
www.neotechnology.com


More information about the User mailing list