Yes you must call both

The idea is that you have to explicitely confirm that the tx is successful 
before closing it

Not confirmed tx will be rolled back on close()

Von meinem iPhone gesendet

> Am 05.10.2014 um 14:02 schrieb Frandro <[email protected]>:
> 
> The following code newly begins transaction each 1000 batch job.
> 
> Is the following code correct?
> 
> Do I have to invoke the tx.close() method each 1000 batch job in the middle?
> 
> It seems there's no problem without calling the method.
> 
> What are success() and close() for? It's confusing.
> 
> Transaction tx = mGraphDb.beginTx();
> 
> int count = 0;
> 
> try
> {
>     if(count % 1000 == 0)
>     {
>         tx.success();
>         tx.close();                                   // should this be 
> called?
>         tx = mGraphDb.beginTx();
>     }
> 
>     count++;
>             
>     tx.success();
> } finally {
>     tx.close();
> }
> 
> 
> -- 
> 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