Uploaded image for project: 'JBRULES'
  1. JBRULES
  2. JBRULES-1330

Using RuleBase in multithread application server environment

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 4.0.3
    • Fix Version/s: 4.0.5, 5.0.0.M1
    • Component/s: drools-core (flow)
    • Labels:
      None
    • Environment:

      Red Hat Linux as OS, weblogic 9.2 using jrockit-1.5.0_10

    • Affects:
      Release Notes
    • Estimated Difficulty:
      High

      Description

      We are deploying an applcation which has one major component which executes rules.
      At the startup of the application server, we load the various rules and save them in a hashmap with appropriate key. The value of these HashMaps is RuleBase. This is part of a singleton service.
      The applcation is based on JMS. A MDB receives message, calls the sigleton service to get stateful session from a specific RuleBase ( saved in HashMap by key as mentioned above). This singleton service get the RuleBase from Map, call newStatefulSession(false) on this RuleBase object and return the new StatefulSession.
      This works fine as long as we have one MDB on the application server. When we increase the number of MDB's to more than one, and both MDB's process the messages( different messages) simultaneously, the results from stateful session rule firing are messed up. It skips amny valid LHS and so on.
      I even tried using the Stateless Session, but the results are still messed up. So my question is:
      Can we use the Rulebase in multithreaded environment ? My understanding was that we can use it. There should be no interaction between various stateful sessions received from same rulebase object. If we can't use it this way, the we have build it form PackageBuilder for every invocation. There are lots of complex rules and for hundreds of calls it adds up to considerable waste of resources.
      Thanks for reading this bug report
      Can you please post or email me the code to use the statefule sessions from a RuleBase object in multithreaded environment?

        Gliffy Diagrams

          Attachments

          1. Droolsmt.zip
            31 kB
          2. log.txt
            6 kB

            Issue Links

              Activity

                People

                • Assignee:
                  tirelli Edson Tirelli
                  Reporter:
                  navaljit Navaljit Bhasin
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: