JoobDeadlockException

A JoobDeadlockException is thrown when JADE detects that a lock request would result in a deadlock condition. The lock request can be explicit or implicit, including when committing a transaction involving update locks.

At a minimum, the JADE session must abandon the lock request and release the lock that was blocking the other session. If the JADE session is in transaction state, the transaction must be rolled back in order to release the lock. Rolling back the transaction releases all transaction duration locks.

The JoobDeadlockException object properties that indicate details about the deadlock are listed in the following table.

Property Type Description
LockTarget ObjectId Identifies the object requested to be locked
LockType LockType The requested lock type
LockDuration LockDuration The requested lock duration
LockTimeout TimeSpan The requested lock timeout period
TargetLockedBy ObjectId Identifies the JADE session that has the object locked
ObtainedLock ObjectId Identifies the object that the requesting JADE session has locked, which caused the deadlock

The following code fragment is an example of displaying JoobDeadlockException information.

catch ( JoobDeadlockException dlException )
{
    Console.WriteLine("Requested object {0}", dlException.LockTarget.ToString());
    Console.WriteLine("Requested type {0}", dlException.LockType.ToString());
    Console.WriteLine("Locked by {0}", dlException.TargetLockedBy.ToString());
    Console.WriteLine("Obtained lock {0}", dlException.ObtainedLock.ToString());
    //...
}