Collection Concurrency (JAD-I-423)
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 now provides:
-
Conditional collection operations
-
New collection methods that allow updates to persistent collections to be deferred
-
New deferred update modes for automatic multi‑valued inverses
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:
-
Deferred execution methods can be called at any point within the transaction. Since a deferred execution does not lock the collection, multiple processes can execute the deferred operations concurrently.
-
Handles concurrent additions or removals of the same object executed by different processes in overlapping transactions.
-
Provides a deadlock avoidance strategy.
-
If application logic does not read the collection in the updating transaction, a shared‑to‑exclusive lock upgrade does not occur.
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; otherwise exception 1471 (Collection locking is incompatible with prior updates) is raised (PAR 67879).
The Process class now provides the
The Collection class now provides the abstract
The Dictionary class now provides the abstract
Collection types that can contain objects provide
Deferred Execution Common Behavior
The following behavior is common to deferred execution.
-
A deadlock avoidance strategy; that is, updates to multiple collections are grouped and processed in collection OID order
-
Add and remove operations are processed in the order in which they were queued
Development Environment Changes
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).
New .NET API Methods
JADE now provides .NET API methods for conditional and deferred collections, as follows.
-
JoobCollection class methods
-
TryAdd
-
TryAddDeferred
-
TryRemove
-
TryRemoveDeferred
-
-
JoobDictionary class methods
-
TryPutAtKey
-
TryPutAtKeyDeferred
-
TryRemove
-
TryRemove
-
TryRemoveDeferred
-
-
DynamicDictionary class method
-
TryRemoveDeferred
-
-
ExtKeyDictionary class method
-
TryRemoveDeferred
-
-
JoobSession class methods
-
OverrideDeferredInverseMaintenance
-
UseDeferredInverseMaintenance
-
-
IJoobCollection interface methods
-
TryAdd
-
TryAddDeferred
-
TryRemove
-
TryRemoveDeferred
-
These are documented in the JADE .NET API JadeDotNetAPI.chm file, which is in the installed JADE documentation directory (for example, C:\Jade\JADE Docs\documentation).