2 Replies Latest reply on Sep 5, 2008 1:21 PM by Vladimir Kovalyuk

    SMPC in nested conversations and entity passivation problem

    Vladimir Kovalyuk Apprentice

      I faced StaleStateException when restoring parent conversation context. The exception was thrown by HibernatePersistenceProvider.


      The problem was in fact that entity was passivated with its JPA version. After the inner conversation had modified the entity and SMPC had been flushed the parent conversation was restored.
      Since SMPC is shared among inner conversations it had already contained newer instance and the exception was thrown.


      I apologize for not providing example code due to lack of time.  I figured out that Seam does not check version of instance if bean does not implement Mutable interface. The entity was passivated under the key that  looks like org.jboss.seam.CONVERSATION$entityHome.instance. I just switched to my class that serves entities and does not implement Seam's Mutable interface and problem disappear.


      But I'm afraid the problem will appear indirectly in clustered environment if passivation is used to get fine grained replicas.


      I believe since PC is shared among conversations the process of activating passivated entities should take into account that instances could be modified by inner conversations. What do you think?