[rules-users] is threadSafe required for external func call?

Mark Proctor mproctor at codehaus.org
Tue Nov 11 17:44:14 EST 2008


techy wrote:
> Hello,
> >From the below example, Do I need to make function
> "incrementExecutionCount()" threadSafe here or does drools make threadSafe
> call to external functions? Please someone clarify. Thanks.
>   
Drools is single threaded, it will only execute one rule at a time, so 
as long as nothing from outside of the engine is calling that function, 
you don't need to worry.
> global SampleDao dao;
> rule "1"
>  when "some condition on fact"
>   then
>      Rule r = dao.getRule("1");
>      r.incrementExecutionCount();
> end
>   





More information about the rules-users mailing list