I'm going to be interacting with a KnowledgeBase in a web application.  I do
not expect the rules to change during the running of the application.  I
will be using StatelessKnowledgeSessions exclusively.

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.

I assume that the best strategy is to:

   - Locate the KnowledgeBase in the ServletContext upon startup
   - Read in the rule base at startup in a synchronized block (I don't think
   the servlet specification guarantees that a ServletContextListener is
   thread-safe at startup, but maybe this is overkill)
   - During runtime, synchronize on the rule base while acquiring a
   StatelessKnowledgeSession from the ServletContext
   - Use the acquired StatelessKnowledgeSession freely, without any further
   concern for locking (after all, it's stateless, right?)

Could someone please correct me if any of these statements is wrong?

Thanks,
Laird
_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to