Lock and Unlock Functions

TIBCO BusinessEvents provides lock and unlock functions.

Lock Function

The TIBCO BusinessEvents lock function has the following format:

Cluster.DataGrid.Lock(String key, long timeout, boolean LocalOnly)

If you want to acquire the lock only within the agent, set LocalOnly to true. Set the LocalOnly parameter to false to acquire a cluster wide lock. For example if you are only concerned about the preprocessor threads in one agent, you can use a local lock. The worker thread that calls the lock() function is the only thread that gets blocked.

Unlock Function

All the locks acquired during event processing are released automatically after all post RTC actions, cache operations (and database writes in the case of cache-aside mode) are done.

The format of the unlock function is as follows:

Cluster.DataGrid.UnLock(String key, boolean LocalOnly)

You can use the corresponding UnLock() function for cases where the automatic unlocking does not meet your needs.

Note: The Cluster.DataGrid.Lock() and Cluster.DataGrid.UnLock() functions are available in event and subscription preprocessors and in rules. However, in general it is not a good idea to use lock() in rules as the order of processing of rules is not guaranteed. You can call Cluster.DataGrid.UnLock() in a rule only when concurrent RTC is used.