0 Replies Latest reply on Apr 9, 2010 8:42 AM by kaned

    Pessimistic locking in a clustered environment

      Hi,

       

      Our first implementation of jBPM uses 3.2.6 and we need to cater for concurrent users in a clustered Tomcat environment.

       

      More specifically we need to ensure that when we update a process definition, it is "locked" until the update completes and any other threads wait until the lock is released before being able to read or write the process definition.

       

      We were under the impression (advice given by a Redhat consultant) that the

      getProcessInstanceForUpdate(processInstanceId) method on the JbpmContext class would carry out a "SELECT FOR UPDATE" at the database level and we have implemented our solution around this.

       

      However, having read the java doc for this method -

      http://docs.jboss.org/jbpm/v3/javadoc/org/jbpm/JbpmContext.html#loadProcessInstanceForUpdate(long)

      it simply states that it is a convenience class that means that will automatically save the updates to the process instance when the context is closed.

       

      I've seen anothe post that suggests we need to apply the SELECT FOR UPDATE lock programatically

      http://community.jboss.org/message/373432#373432

       

      Can someone confirm the way to apply pessimistic locking in a clustered environment ?

       

      Cheers,

       

      Des Kane.