Uploaded image for project: 'Seam 2'
  1. Seam 2
  2. JBSEAM-4760

PassivatedEntity class only passivates entities belonging to first entity manager

    Details

      Description

      This bug only applies when all of the following apply:
      1. You have more than one entity manager e.g. "myEntityManager1" and "myEntityManager2"
      2. You have enabled the MEI (e.g. via the distributable="true" attribute on the init component in components xml)

      When performing fail-over from one node to another, the PassivatedEntity class should re-attached the the entity instance by cycling through each entity manager.

      Extract from PassivatedEntity.java
      158: for ( String persistenceContextName: PersistenceContexts.instance().getTouchedContexts() )
      159:

      { 160: Object persistenceContext = Component.getInstance(persistenceContextName); 161: return createPassivatedEntity(value, entityClass, persistenceContextName, persistenceContext); 162: }

      However, this loop only examines the first touched PersistenceContext and ignores all others. I have submitted a patch that changes this to:

      158: for ( String persistenceContextName: PersistenceContexts.instance().getTouchedContexts() )
      159: {
      160: Object persistenceContext = Component.getInstance(persistenceContextName);
      161: PassivatedEntity passivatedEntity = createPassivatedEntity(value, entityClass, persistenceContextName, persistenceContext);
      162: if (passivatedEntity != null)

      { 163: return passivatedEntity ; 164: }

      165: }

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                pbrewer_uk Peter Brewer
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: