Loading...
 

CX_OBJECT_MANAGER::EnableDeadlockPrevention

CX_OBJECT_MANAGER::EnableDeadlockPrevention

214458
Description:

To prevent deadlocks between several clients caused by the use of upgradeable locks, ClassiX performs an implicit BeginLock(WRITE) in CreatePersObject before inserting the object into the REP and in TriggeredStateMonitor() before accessing the start state and an EndLock after the operation is finished. This prevents multiple clients running the same code at the same time from deadlocking each other by the upgradeable locks in these calls (as long as they are working on the same data).

Changing the database locking mode is relatively expensive and can be significant in loading runs that create massively persistent objects and, depending on the type of loading routine, take up to 25% of the loading time(CreatePersObject is about 4 times slower). Since for most loading processes only one client holds the database open and fills it and thus the possibility of a deadlock is excluded anyway, the mechanism can be deactivated for these cases to speed up the loading process.

In regular operation, however, the delay caused by this is not measurable and the mechanism should always remain activated to prevent deadlocks. The option is activated by default after system startup.

Code example:
FALSE GetManager(OBJECT) Call(EnableDeadlockPrevention)
do {
  ...
  CreatePersObject(...)
} while

Stack
Stack Position Object type Brief description
Stack(In) Top CX_OBJECT_MANAGER
Top 1 INTEGER TRUE(1) = Activated
FALSE(0) = Disabled
Stack(Out) Top - -
Function call: Call(EnableDeadlockPrevention)