5 Replies Latest reply on Apr 9, 2010 7:19 AM by marcel.de.koster

    Jbpm 4 and ehcache

    marcel.de.koster

      Hi,

       

      I'm wondering about enabling ehcache in jbpm4. I searched alot around the forum and the web, but did not find a satifying answer. If there is one please point me into that direction.

       

      I see no <cache> tags inside the hibernate mappings files of jbpm4, so I'm wondering if it is even possible. I added all the hibernate configuration to enable it, but I feel like it is not used.

       

      So what I did:

       

      <property name="hibernate.cache.provider_class">net.sf.ehcache.hibernate.SingletonEhCacheProvider</property>

      <property name="net.sf.ehcache.configurationResourceName">conf/ehcache.xml</property>
      <property name="hibernate.cache.use_second_level_cache">true</property>
      <property name="hibernate.cache.region_prefix">business-process</property>
      <property name="hibernate.cache.use_query_cache">true</property>
      <property name="hibernate.cache.use_minimal_puts">true</property>

       

      If it is possible, can anyone provide a sample ehcache.xml?

       

      Thanks in advance for any response.

        • 1. Re: Jbpm 4 and ehcache
          marcel.de.koster

          In some pages I found that following configuration can be added, but I can't find a resource for jbpm.pvm.cache.xml:

           

          <hibernate-configuration>

             <!-- other config -->
             <cache-configuration resource="jbpm.pvm.cache.xml" usage="nonstrict-read-write" />
          </hibernate-configuration>

           

          Is there any example of the jbpm.pvm.cache.xml?

           

          And from what version of jbpm4 is this available?

          • 2. Re: Jbpm 4 and ehcache
            rebody

            Hi Marcel,

              At this moment, jBPM4 does not support ehcache configuration for hibernate. The configuration you have found is included by jBPM-4.0-Alpha2. It is removed by some reason(Maybe). There is a huge change from jBPM-4.0-alpha2 to jBPM-4.3, so I don't think it could be used in jBPM-4.3 directly.

             

              The configuration for jBPM-4.0-alpha2 is in the attach, maybe you could let it be used in jBPM-4.3.

             

              Best regards.

            • 3. Re: Jbpm 4 and ehcache
              marcel.de.koster

              Hi Huisheng,

               

              Thank you for your quick reply.

               

              I will look into what I can do with that file. jBPM indeed is pretty fast. But what I see in oracle is that the Get jobs query, done by the JobExecutor is done each 5 seconds. Not using ehcache or some other caching will result in executing this query every 5 seconds. It would be nice if the query was only executed when the cache is flushed by a new job being added, changed or deleted. In other cases it could be served from the cache.

               

              If I find any kind of way of caching in jbpm I will post it here.

               

              Regards,

              Marcel

              • 4. Re: Jbpm 4 and ehcache
                swiderski.maciej

                Take a look at this post http://community.jboss.org/thread/150387

                 

                Maybe it can do help you a bit or at least be a starting point.

                 

                Cheers

                Maciej

                • 5. Re: Jbpm 4 and ehcache
                  marcel.de.koster

                  Hi Maciej,

                   

                  I posted a reply on the other post http://community.jboss.org/thread/150387

                   

                  Thanx for the link.

                   

                  Best Regards,

                  Marcel