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.<br><br>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.<br>
<br>I assume that the best strategy is to:<br><ul><li>Locate the KnowledgeBase in the ServletContext upon startup</li><li>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)</li>
<li>During runtime, synchronize on the rule base while acquiring a StatelessKnowledgeSession from the ServletContext</li><li>Use the acquired StatelessKnowledgeSession freely, without any further concern for locking (after all, it's stateless, right?)</li>
</ul>Could someone please correct me if any of these statements is wrong?<br><br>Thanks,<br>Laird<br>