Handling Deadlocks

When a deadlock situation is detected between two processes, JADE provides flexibility in choosing which process should be given the deadlock exception. Processes have separate priorities for resolving deadlocks involving persistent objects and shared transient objects.

A process can set a "deadlock priority" value. When a deadlock occurs between two processes, the process that has the lower priority is given the deadlock exception. If the processes have identical priorities, the process that was requesting the lock is given the deadlock.

If double deadlock detection is enabled, both processes are given a deadlock exception, regardless of their relative priorities.

The deadlock priority value is a signed integer, with the default value being zero (0).

For details about the Process class getPersistentDeadlockPriority, getTransientDeadlockPriority, setPersistentDeadlockPriority, and setTransientDeadlockPriority methods, see Chapter 1 of the JADE Encyclopaedia of Classes.

See also the DoubleDeadlockException parameter in the [JadeServer] section of the JADE initialization file, in the JADE Initialization File Reference.