Subject Re: [ib-support] wait transactions and rollback
Author Woody
From: "Danny Garcia Hernandez" <danny@...>
> hi helen:
> i cant understand why wait transantion cant be used, if i want a
> trasanction wait until the first transaction commit the change, then,
> first transaction finish, last trasaction can continue the actions. Where
> the conflict?, i dont want the last trasaction comeback and show a message
> to the user saying "the record is using, retry later".

That's not quite how wait transactions work. If the first user commits
his/her changes, then the second user will still get an error, it just waits
until the commit to do so. If the first user rolls back their changes, then
the second one will go through since nothing really changed.

> Can you help me to undestand?. Maybe my problems is in the way to
> the counters.
> I think too that generator is not a good option because the counters would
> be consecutive
> 1,2,3,4,5.

If you switch to no-wait transactions, the error will be returned right away
and you can handle it in a loop that keeps trying until it succeeds. In most
cases, this will be a very short time period if it happens at all. You could
even put a counter in the loop that let's the user know the counter is
locked by another user after 10 tries (or something like that) and asks if
they want to continue trying or give up and try again later.

Woody (TMW)