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.

You can use the allSharedTransientInstances, firstSharedTransientInstance, and lastSharedTransientInstance methods in a production system if you have implemented a mechanism that ensures that there are no uncommitted creates or deletes of instances at the time of execution of the method.

The collection of instances from the database may not be consistent with updates made by existing uncommitted transactions that are still in a client node cache. For example, if overflow has occurred, the collection may contain instances that have been created, and deleted 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 environment.

For these reasons, unless you have implemented a mechanism to block updates, as stated in the note earlier in this topic, the allSharedTransientInstances, firstSharedTransientInstance, and lastSharedTransientInstance methods are not recommended for production use in a JADE application. Such use is appropriate only as a development diagnostic or testing aid.