users@glassfish.java.net

Re: Optimistic Locking and deadlocks, why?

From: <glassfish_at_javadesktop.org>
Date: Wed, 26 Nov 2008 10:36:31 PST

Deadlock can happen if you are trying to update 2 rows in 2 parallel transactions in different order.

Say you changed A and B in both transactions. T1 flushes update to A and T2 flushes an update to B first. Now T1 waits for T2 to commit to be able to update B, but T2 is waiting for T1 becauyse it needs to update B.

Can you enable logging to see the exact cause of the deadlock?

thanks,
-marina
[Message sent by forum member 'mvatkina' (mvatkina)]

http://forums.java.net/jive/thread.jspa?messageID=318873