Hi Laird,

In our web application we create one KnowledgeAgent and each session calls  getKnowledgeBase to get the KnowledgeBase and then getStatelessSession to get a session.  We have not had any threading issues.  I'm pretty sure that each of those operations are thread-safe.

Hope this helps,
Steve

rules-users-bounces@lists.jboss.org wrote on 11/02/2009 09:13:01 AM:

> [image removed]

>
> Re: [rules-users] Rookie question: best place to locate
> KnowledgeBase in web application?

>
> ljnelson

>
> to:

>
> rules-users

>
> 11/02/2009 09:16 AM

>
> Sent by:

>
> rules-users-bounces@lists.jboss.org

>
> Please respond to Rules Users List

>
>
>
> ljnelson wrote:
> >
> > My question is: where is the best place to put the various parts, and what
> > sort of synchronization do I need to worry about?  I did not see any
> > reference to these issues in the (massive, otherwise excellent) Drools
> > documentation.
> >
>
> Well, OK, that generated a lot of traffic.  :-)
>
> Talking to myself here, let's expand this out a bit and say: OK, how would
> we do this inside a stateless session bean?  I am loathe to write a resource
> adapter for Drools.
>
> Given that, and that I'm working with stateless sessions exclusively, I'm
> also willing to live with several instances of Drools--i.e. if I create the
> engine as an instance variable (or static variable) inside my SLSB, I'm
> willing to live with the fact that the container might (probably will)
> create several instances of my SLSB, and hence several instances of my rules
> engine--they'll all be reading the same rules information so should vend the
> same results.
>
> My main question, for the two of you still reading, is around
> synchronization: I understand that a StatelessKnowledgeSession is thread
> safe, but what about acquiring it?  Where else, if anywhere, will I run into
> threading issues?
>
> Thanks,
> Laird
> --
> View this message in context:
http://old.nabble.com/Rookie-question%
> 3A-best-place-to-locate-KnowledgeBase-in-web-application--
> tp26152111p26157126.html
> Sent from the drools - user mailing list archive at Nabble.com.
>
> _______________________________________________
> rules-users mailing list
> rules-users@lists.jboss.org
>
https://lists.jboss.org/mailman/listinfo/rules-users