Sorry to bring it up again - just was wondering if anybody knows the answer to my
questions below, or maybe it is already somewhere in the documentation?
----- Original Message ----
From: Marina <ppine7(a)yahoo.com>
To: Rules Users List <rules-users(a)lists.jboss.org>
Sent: Friday, August 22, 2008 3:42:01 PM
Subject: [rules-users] how do RuleBase.lock()/unlock() functions work?
I am researching how to do thread safe update of packages/rules in a rulebase. I noticed
that there are lock() and unlock() methods on the RuleBase object, but could not find much
documentation on how they could be used.
I am trying to implement the following scenario and was wondering if someone could verify
that I am using the lock functionality correctly in this case:
Threads 1 and 2 use the same rulebase object.
Quesion 1: What does it mean having the rulebase be locked in Thread1? Does it mean, that
if Thread2 is trying to get the session , say, between steps1.2 and 1.3 of the Thread1 ,
then it will wait until Thread1 released the lock on the rulebase?
If that's true, that's exactly what I need.
Question 2: I also see methods rulebase.getAdditionsSinceLock() and
getRemovalsSinceLock(). Who will see anything when calling these functions - Thread1 after
operation 1.5? before 1.5?
Or Thread2? But, which lock would it mean to Thread2? - it woudl probably not even be
aware of any locks being place by other threads??
rules-users mailing list