[rules-users] Streaming mode

Wolfgang Laun wolfgang.laun at gmail.com
Sun Mar 4 02:53:30 EST 2012


Richard,

you have hinted at the lack of thread-safety before, and you were kindly
asked to provide a demo for this bug, as it ought to be fixed, but so far
you haven't provided one - or did I miss that? Other than this,
StatefulKnowledgeSession sure is intended to be thread-safe.

-W


2012/3/4 Richard Calmbach <rcalmbac at gmail.com>

> 2012/3/2 Matteo Cusmai <cusmaimatteo at gmail.com>
>
>> i see that there are some other threads that insert new event and some
>> others retract them.
>> How is the thread model?
>>
>
> Contrary to claims made on this mailing list, StatefulKnowledgeSession is
> not thread-safe (this may be due to bugs, but bottomline is: it's not
> thread-safe). In order to avoid errors due to multi-threading, don't use
> fireUntilHalt(), instead synchronize on the session and only call insert()
> and fireAllRules() while synchronized on the session:
>
>     synchronized (session) {
>         entryPoint.insert(event);
>         session.fireAllRules();
>     }
>
> -Richard
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20120304/aed41610/attachment.html 


More information about the rules-users mailing list