Open topic with navigation

TIBCO BusinessEvents® Enterprise Edition 6.3.1

# Multiple Keys Protect One Object

In the simplest cases you can use some unique feature of the object you want to protect as the locking key, for example, a customer ID. However different events may point to the same objects using different information. For example, from one channel, the object may be identified using customer ID, and from another, using account ID. In such cases multiple keys are used to identify the same object. When you acquire a lock to protect such an object, you must first get the other key from your system, sort the keys and take a lock on both keys. Sorting can be implemented using a custom function.

If the ordering of keys is not guaranteed, it may lead to a deadlock in a multi-agent or concurrent RTC (multi-threaded) environment. For this reason, avoid use of `lock()` in a loop, where the intention is to process multiple messages. There are other ways to achieve this, for example, using the `assertEvent_Async()` function.

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.