On Sat, May 10, 2008 at 9:04 PM, Philip Jägenstedt <[EMAIL PROTECTED]> wrote:
> Perhaps my question could also be phrased as:
>
> What happens if tx.finish() is never called? I don't know what tomcat
> does when it times out, but I expect it might kill the running servlet
> quite "brutally".
>

If tx.finish() is never called the transaction will never be committed
or rolled back (holding locks/memory).

>
> On 5/10/08, Philip Jägenstedt <[EMAIL PROTECTED]> wrote:
>> Hi again,
>> ...
>>  Most of that is irrelevant, but anyway... does the indexing service do
>>  some transaction handling internally, how ought I write my code to
>>  guarantee that this can't happen?

When manually managing transactions always make use of a try finally block:

Transaction tx = neo.beginTx();
try
{
    ... do work in transaction
    tx.sucess();
}
finally
{
    tx.finish();
}

That way the transaction will always be committed or rolled back.

-Johan
_______________________________________________
Neo mailing list
[email protected]
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to