Product Information > JADE Encyclopaedia of Classes – Volume 1 > Chapter 1 - System Classes > Caveat When Handling Shared Transient Class Instances

Caveat When Handling Shared Transient Class Instances

The allSharedTransientInstances, firstSharedTransientInstance, and lastSharedTransientInstance methods of the Class class employ a method that retrieves references to shared transient instances of a class (and optionally its subclasses) from the transient database.

The collection of instances may not be consistent with updates made by existing uncommitted transient transactions that are still in a client node cache. For example, the collection may contain instances that have been deleted, and newly created instances may be missing.

In addition, this type of access has no form of concurrency control that can guarantee a consistent view or "snapshot of instances" for the operation as a whole in a multiuser or thin client environment.

For these reasons, the allSharedTransientInstances, firstSharedTransientInstance, and lastSharedTransientInstance methods are not recommended for production use in a JADE application. They are intended more for a development diagnostic or testing aid.

The allSharedTransientInstances, firstSharedTransientInstance, lastSharedTransientInstance, allProcessTransientInstances, firstProcessTransientInstance, and lastProcessTransientInstance methods function correctly, regardless of whether they are executed on the client node or server node. These methods copy all relevant created, updated, or deleted objects from the server node to the client node, ensuring that all the relevant objects have copies on the transient or shared transient file (as appropriate), and then searching the file.

Using these functions in server execution methods causes extra overhead, because all created, deleted, and updated objects of the specified class have to be copied across to the client node and the core of the function is executed on the client node. In addition, if they are executed from a nested clientExecution method, any transient objects created by the serverExecution methods have to be sent across the network and removed from the server node.