So there must be a place where transactions are not correctly closed? Or do you
have a large outside tx that causes your other transactions to be only nested
transactions?
If you look at JMX you should be able to see the currently open transactions.
And there are some methods to see if there is still a transaction running, even
after you closed yours:
final TransactionManager txManager = ((GraphDatabaseAPI)
db).getDependencyResolver().resolveDependency(TransactionManager.class);
return txManager.getStatus() != Status.STATUS_NO_TRANSACTION;
Michael
Am 23.06.2014 um 17:22 schrieb Mattia Pellè <[email protected]>:
> Hello,
> from the stack-trace we notice that the transactions take up most of the
> memory. Nodes and relationships are bound in soft-reference. In the example
> that generated the error we have 500 nodes, for any nodes we do 28k atomic
> operations (getNode,getEdge,....). An atomic operation opens and closes a
> transaction.
> Is there a method to avoid nested transactions in this case?
>
> Thanks.
>
> Mattia
>
>
> Il giorno lunedì 23 giugno 2014 12:58:09 UTC+2, Michael Hunger ha scritto:
> 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.
--
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.