Open topic with navigation

TIBCO BusinessEvents® Enterprise Edition 6.3.1

# Lock Processing Example Flow

The following example demonstrates common locking requirements.

Figure 6: Lock Processing Workflow

Two agents receive messages that require changes to one Customer instance.

Note that event preprocessors are multi-threaded (see Event Preprocessors for more details).

1. A message comes into a channel on Agent A: a change to a customer address. TIBCO BusinessEvents dequeues the message from the queue, deserializes the message to an event, and calls the event preprocessor function. The preprocessor acquires a lock using the customer’s `extID` as the key:

       Cluster.DataGrid.Lock(Customer@extId, -1, false);

   This function causes the thread to stop until it gets the lock. In this example, the thread gets the lock.

2. Only one thread handles the RTC. Other event preprocessor threads go into a queue. During the RTC, a rule executes and modifies the customer address. After RTC completes, the post RTC phase begins: the address change is written to L1 cache, the cluster cache, and the backing store in parallel. Messages arising from the RTC are sent.
3. After the post RTC actions are completed, the lock is released.
4. Agent B that contains the same function shown in Step 1 (hence the same locking string) can now acquire the lock that is the function returns `true`. It proceeds with rule execution and post RTC phase and finally releasing the lock.

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.