How to avoid concurrent access to the same object triggered by timeEvents
book
Article ID: KB0085392
calendar_today
Updated On:
Products
Versions
TIBCO BusinessEvents Enterprise Edition
-
Not Applicable
-
Description
Resolution: Description: =========== Based on the timeEvent, we are going to create some new concepts. TimeEvents scheduled by different inference agents may carry the same information for concepts.
How to avoid potential concurrent access to the same object triggered by timeEvent?
Environment: ========== TIBCO BusinessEvents 3.x
Resolution: ========= Multiple threads must coordinate access to objects through appropriate use of locking. Usually we do locking in the event preprocessor to prevent multiple threads from accessing one object at the same time.
But preprocessor does not apply to timeEvent.
To avoid potential concurrent access to the same object triggered by timeEvent, you may consider using simple Event instead of timeEvent: 1). Instead of timeEvent, schedule simple Event with scheduler(Cluster.createScheduler and Cluster.scheduleEvent). Then Do locking and preloading in the preprocessor for the simple event. Cluster.scheduleEvent Schedules a simple event and send the simpleEvent to its default destination on scheduledTime.
Or if you have to use timeEvent: 2). After timeEvent asserted into working memory, in the rule for timeEvent, create and send a simple event with the same information. Do the object access related jobs based on the simple event. In the preprocessor for the simple event, using locking to prevent the concurrent access to the same object.
Issue/Introduction
How to avoid concurrent access to the same object triggered by timeEvents