Collection Concurrency

Locks on persistent collections create a bottleneck that affects most production multiuser systems in some way. Minimizing contention and avoiding deadlocks is a challenge for developers. To help with these challenges JADE provides:

The deferred execution model is a good choice when applied to collections that are updated but not read within a database transaction. Some of the benefits of deferred execution are:

The deferred add and remove operations are not visible to the calling process until after the enclosing transaction has committed.

The ExternalCollection and JadeBytes classes do not implement any of the tryxxx methods. Attempts to call these raise exception 1068 (Feature not available in this release).

Deferred execution methods and non‑deferred execution updating methods cannot be called on the same collection within the same transaction. Attempts to do so raise exception 1471 (Collection locking is incompatible with prior updates).

The Process class provides the useDeferredInverseMaintenance and overrideDeferredInverseMaintenance methods, which support enabling or disabling deferred execution for all automatic or manual/automatic inverse collection properties for the current process.

The Collection class provides the abstract tryAdd and tryRemove conditional methods, which are implemented by the Array, DynaDictionary, ExtKeyDictionary, and Set classes. In addition, it provides the tryCopy__ conditional method, which is implemented by the Array, Dictionary, and DynaDictionary classes.

The Dictionary class provides the abstract tryPutAtKey, tryRemoveKey, and tryRemoveKeyEntry conditional methods, which are implemented by the DynaDictionary, ExtKeyDictionary, and MemberKeyDictionary classes.

Collection types that can contain objects provide tryAddDeferred, tryAddIfNotNull, tryPutAtKeyDeferred, tryRemoveDeferred, tryRemoveKeyDeferred, tryRemoveIfNotNull, and tryRemoveKeyEntryDeferred deferred conditional methods.

Deferred Execution Common Behavior

The following behavior is common to deferred execution.

JADE Development Environment

The Update Mode group box on the extended Define References dialog in the JADE development environment provides the Deferred Execution check box. You can check or uncheck this check box only when the Automatic or Man/Auto option button is selected (that is, it is disabled when the Manual update mode is selected or the corresponding Type is not a Collection or a Collection that does not support deferred update modes).

2020.0.01 and higher