4 Replies Latest reply on May 9, 2008 1:41 PM by pmuir

    Jbpm using seam managed entityManager

      Jbpm and seam using the same entityManager makes sense, because storing entities in variable context and refernecing processInstance or token from entities is possible.


      I have the following problem though. My SeamPersistenceService Implementation of Jbpm's PersistenceService is closed with the destruction of the ManagedJbpmContext. Since ManagedJbpmContext is in scope EVENT and entityManager in scope CONVERSATION the entityManager is destroyed before. Jbpm tries to save the log entities upon close and thus fails because the seam managed entityManager is gone and even closed.


      In my scenario it would help to close JbpmContext in the destroy Method of managedJbpmContext. Transactions and Connections are managed by JbpmContext anyways. Unfortunately direct access to the entityManager will not be possiblle in destroy because the entityManager is removed from Contexts before the ManagedJbpmContext. Maybe ManagedJbpmContext should also be in the Conversation scope.



      Could you include an alternative version of ManagedJbpmContext that works with a SeamPersistenceService?