0 Replies Latest reply on Jan 7, 2008 10:02 AM by Clint Popetz

    ManagedPersistenceContext in clustered environment -> closed

    Clint Popetz Apprentice


      ManagedPersistenceContext, upon passivation, checks to see if the entity manager is dirty, and if not, closes it. I presume this is intended as an optimization. But in a clustered environment, where a snapshot of the session is taken upon each request that dirties the session, passivation will occur frequently within a conversation. In this case, the entity manager is frequently closed and recreated upon the next request, and entities in conversational beans become detached, and all sorts of bad things happen when I try to use them in the new session.

      I think that to preserve the promise of long conversations, we have to keep the persistence context open across passivation, regardless of whether it's dirty.

      Am I misunderstanding something? If not, please verify this is problematic, and I'll file a Jira issue.