David Wall <[EMAIL PROTECTED]> wrote:
>>Optimistic locking cannot mean "you won't have deadlock."
>Yes it does. Deadlocks are prevented by keeping several versions of the
>same instance (one for each tx), hence there will be no deadlocks since
>two tx's cannot lock on the same instance.

No it doesn't. Consider the following scenario:
TX1 updates A, intends to Update B, cannot see TX2's updates to B,
TX2 updates B, intends to Update A, cannot see TX1's updates to A

If A and B could see that their intended record has been modified,
they could rollback back (principal of optimistic locking) back but
transaction isolation ensures they cannot see each others updates.
Hence we have a deadlock situation.

Regards,
Hamid

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to