Where exactly does that error happen, can you share a stack-trace?

And what do you do with the Node and Neo4J2Edge objects after you retrieved 
them? Do you keep them somwhere?

Michael

Am 23.06.2014 um 12:36 schrieb Mattia Pellè <[email protected]>:

> Hi,
> we use the following code: 
> 
> try (Transaction tx = db.beginTx()) {
>    // read or write data
>    tx.success();
> }
> 
> We have the OutOfMemory error, working with 1 million nodes and 3 million 
> relationships. 
> Most of our functions have a transaction, for read or write in the graph. 
> 
> For example:
> 
> (read)
> 
>   public Node getNode()
>   {
>     Node node = nodeRef.get();
>     try (Transaction tx = graphDB.getGraphDB().beginTx())
>     {
>       if (node == null)
>       {
>         node = (Node) graphDB.getGraphDB().getNodeById(id);
>         setNode(node);
>       }
>       tx.success();
>     }
>     return node;
>   }
> 
> (write)
> 
>   public IEdge addEdge(INode x, INode y, IEdgeType similarityEdgeType, String 
> propertyName, Object value)
>   {
>     Node source = ((Neo4J2Node) x).getNode();
>     Node dest = ((Neo4J2Node) y).getNode();
>     Relationship rel = null;
>     try (Transaction tx = graphDB.beginTx())
>     {
>       rel = source.createRelationshipTo(dest, 
> getRelationshipTypeByEdgeType(similarityEdgeType));
>       rel.setProperty(propertyName, value);
>       tx.success();
>     }
>     return new Neo4J2Edge(rel, this);
>   }
> 
> 
> Thanks.
> 
> Mattia
> 
> 
> Il giorno sabato 21 giugno 2014 17:05:55 UTC+2, Michael Hunger ha scritto:
> What does your code look like?
> 
> Do you close the transaction again?
> 
> 
> try (Transaction tx = db.beginTx()) {
>    // read or write data
>    tx.success();
> }
> 
> Am 20.06.2014 um 10:19 schrieb Mattia Pellè <[email protected]>:
> 
>> Hello,
>> we are migrating on the new neo4j 2.1.x but after some test we notice that 
>> with the same code (changed only for the need of transaction and label)
>> we are receiving heap space error. The parameters are the same and the 
>> configuration of the jam are the same, but with the new version we are 
>> getting this error.
>> Is there some hint in the use of the transactions? Are we missing something 
>> that is required in the new version?
>> 
>> Thanks for your advice,
>> 
>> Mattia Pellè
>> 
>> 
>> 
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Neo4j" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> For more options, visit https://groups.google.com/d/optout.
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Neo4j" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to