Open topic with navigation

TIBCO BusinessEvents® Enterprise Edition 6.3.1

# 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.

Did you find this helpful?

YesNo
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO BusinessEvents® Enterprise Edition

Copyright © 2004-2024. Cloud Software Group, Inc. All Rights Reserved.