Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-1002

Drools Persist does not work with kmodule.xml configuration

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Minor
    • 6.4.0.Beta1
    • 6.3.0.Final
    • core engine
    • None
    • Hide

      1. Set up environment with Entitymanager and Transaction Manager

      2. Create a kmodule.xml with a session set up something like this:
      <ksession name="ksession1" type="stateful" default="true" clockType="pseudo" beliefSystem="jtms">

      3. Retrieve the KieContainer and the KieBase for that session:
      KieServices ks = KieServices.Factory.get();
      KieContainerImpl kContainer = (KieContainerImpl) ks.getKieClasspathContainer();
      KieBase newKieBase = kContainer.newKieBase("kbase1", null);

      4. Create a statefulsession (either through StorageService or statically through JPAKnowledgeService) passing in the kiebase and the Environment.

      5. The default keyword is ignored, the session created has non of the attributes set in the xml config.

      Show
      1. Set up environment with Entitymanager and Transaction Manager 2. Create a kmodule.xml with a session set up something like this: <ksession name="ksession1" type="stateful" default="true" clockType="pseudo" beliefSystem="jtms"> 3. Retrieve the KieContainer and the KieBase for that session: KieServices ks = KieServices.Factory.get(); KieContainerImpl kContainer = (KieContainerImpl) ks.getKieClasspathContainer(); KieBase newKieBase = kContainer.newKieBase("kbase1", null); 4. Create a statefulsession (either through StorageService or statically through JPAKnowledgeService) passing in the kiebase and the Environment. 5. The default keyword is ignored, the session created has non of the attributes set in the xml config.
    • Hide

      Workaround for me is in the stackoverflow post. Essentially do manually what kieContainer does, however create the session configuration programatically and set the configuration values there, passing it into the StoreageService.

      Show
      Workaround for me is in the stackoverflow post. Essentially do manually what kieContainer does, however create the session configuration programatically and set the configuration values there, passing it into the StoreageService.
    • NEW
    • NEW

    Description

      Hi,

      I ran into an issue yesterday that I believe to be a bug.

      The persistence configuration through

      ks.getStoreServices().newKieSession(kieBase, ksConf, env);

      does not seem to be considering the configuration set on the kmodule. The kieBase in question is taken from the kmodule.xml configuration. The ksConf and environment are set up to support persistence.

      I also wrote this up here with maybe some more detail and a workaround I am using: http://stackoverflow.com/questions/34134678/drools-kmodule-persistence-configuration/34152339#34152339

      It would be nice to be able to use Kmodule configuration (through xml) in combination with persistent sessions, and preferably maybe configure persistence on a per-session bases in the module. (I hope this makes sense, I am still fairly new to the drools world)

      Attachments

        Activity

          People

            mfusco@redhat.com Mario Fusco
            pandaadb Artur Kronenberg (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: