3 Replies Latest reply on Nov 13, 2009 4:14 AM by Joram Barrez

    JBPM process timers in Multi Server deployment -3.2.6

    Sarish Jain Newbie

      Excuse me for the post, but have done enough searches and dont find info regarding this. Help needed!!

      I am hitting some issues related to using EJB Timer service for deployment, i have used Out of the box config recommended for enterprise deployment.

      First the details of Deployment
      1. 3 jboss 5.1.0 servers hitting the same database
      2. Using JBPM 3.2.6SP1
      3. Oracle is database.
      4. Using Database persisted timers(ejb2 timers), in the same database table TIMERS on all servers, below is the jbpm.cfg.xml

      <jbpm-configuration>
      
       <jbpm-context>
       <service name="persistence" factory="org.jbpm.persistence.jta.JtaDbPersistenceServiceFactory" />
       <service name="message" factory="org.jbpm.msg.jms.JmsMessageServiceFactory" />
       <service name="scheduler" factory="org.jbpm.scheduler.ejbtimer.EntitySchedulerServiceFactory" />
       <service name="tx" factory="org.jbpm.tx.TxServiceFactory" />
       <!-- <service name="logging" factory="org.jbpm.logging.db.DbLoggingServiceFactory" />-->
       <service name="authentication" factory="org.jbpm.security.authentication.DefaultAuthenticationServiceFactory" />
       </jbpm-context>
      
       <!-- use the context class loader
       <string name="jbpm.classLoader" value="context" />-->
      
       <!--
       Note, that the default job executor needs to be overwritten with a null value.
       In the enterprise configuration there should be no job executor.
       Async messaging is there bound to jms and scheduling to ejb timers.
       -->
       <null name="jbpm.job.executor" />
      
      </jbpm-configuration>
      
      


      EJB timer configuration is standard with database persistence JNDI name changed to Oracle database.


      Issues/Observations
      1. I see no issues with async continuations(have 2-3 such async exclusive nodes in my process definition)
      2. But for timers,
      a) Every once in a while these errors show up in server console,I see that this stack is present in more than one servers (which shows the timer fired on more than one server).
      b) On server startup StaleObject Exception related to timer save are seen in plenty.Note only one server is started and stopped at a time.

      I definitely feel that something is wrong with the way it is deployed, as when i looked into EJBTimerService code and i see that on server startup all timers persisted are deleted and reinserted. At this point if some other server already had a timer assigned(it is a thread based implementation), that timer would continue to run and another one would be started on server just restarted as well. And when time comes to fire, both servers would fire the timer. This would result in staleobject exception and hence certainly cause a problem.


      Sorry if my post was not clear, as i have avoided lot of details so that the post is readable. I can provide more info as required. But please recommend if something can be done for this. Also it can be treated as more of a problem with EJBTimerService, but again i am looking at ways in which i can make JBPM timers work in multi server environment. I can not use local database hsql, as that is not allowed in production enviroment.

      Worst case i am thinking of implementing a SingleServerPersistencePlugin for timers, and add an additional column with the server owner name, so that restoreTimers is clearly separated from all other servers. There is a definite problem with failover in such implementation but better get something working then nothing.