Uploaded image for project: 'Red Hat Process Automation Manager'
  1. Red Hat Process Automation Manager
  2. RHPAM-3943

OptimisticLockException in ProcessServiceImpl.getProcessInstanceVariable

    XMLWordPrintable

Details

    • Bug
    • Status: Verified (View Workflow)
    • Major
    • Resolution: Done
    • 7.10.1.GA, 7.11.0.GA, 7.11.1.GA
    • 7.13.0.GA
    • jBPM Core

    Description

      Due to the fix for JBPM-9623, the ProcessInstance is no longer retrieved in readOnly mode when process variables are fetched. This can easily lead to an OptimisticLockException:

      2021-10-05 10:25:43,755 ERROR [org.hibernate.internal.ExceptionMapperStandardImpl] (default task-4) HHH000346: Error during managed flush [Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) : [org.jbp
      m.persistence.processinstance.ProcessInstanceInfo#2463608]]
      2021-10-05 10:25:43,755 WARN  [com.arjuna.ats.arjuna] (default task-4) ARJUNA012125: TwoPhaseCoordinator.beforeCompletion - failed for SynchronizationImple< 0:ffff0a6240ee:5e975dfe:615c0808:84e3, org.wildfly.transaction.client.AbstractTrans
      action$AssociatingSynchronization@3f0df3e6 >: javax.persistence.OptimisticLockException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) : [org.jbpm.persistence.processinstance.ProcessInstanceInfo#
      2463608]
              at org.hibernate.internal.ExceptionConverterImpl.wrapStaleStateException(ExceptionConverterImpl.java:226)
              at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:93)
              at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:181)
              at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:188)
              at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1478)
      ...
              at org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession.execute(CommandBasedStatefulKnowledgeSession.java:544)
              at org.jbpm.kie.services.impl.ProcessServiceImpl.getProcessInstanceVariable(ProcessServiceImpl.java:531)
              at org.kie.server.services.jbpm.ProcessServiceBase.getProcessInstanceVariable(ProcessServiceBase.java:336)
              at org.kie.server.remote.rest.jbpm.ProcessResource.getProcessInstanceVariable(ProcessResource.java:686)
      

      As this call does not update any entities, it should fetch the ProcessInstance in readOnly mode to avoid the update to the SessionInfo object.

      Attachments

        Issue Links

          Activity

            People

              elguardian@gmail.com Enrique González Martínez (Inactive)
              rhn-support-mputz Martin Weiler
              Antonio Fernandez Alhambra Antonio Fernandez Alhambra
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: