When to Use Locking
Depending on your application, locking may not be required in all cases. However it is almost always needed.
For most applications, use locking in the following cases:
With all modes, for reads.
If you want to read the latest version of a concept in one agent at the same time that another agent might create or update the same concept, mediate the reads through the same global lock that was used when creating or updating the concept. This is done using an event preprocessor.
With Cache Only and Store Only modes, for writes.
Global locking is done using an event preprocessor.
With Concurrent RTC (even with In Memory OM or Memory Only mode), for writes.
Multiple RTCs could use the same in-memory object, therefore it needs to be protected using a lock. Use a local lock, not a global lock.
With state modeler, for timeouts.
State modeler timeouts do not go through an event preprocessor, so locking is done a different way. This is explained in
TIBCO BusinessEvents Data Modeling Developer’s Guide.