Uploaded image for project: 'EJB 3.0'
  1. EJB 3.0
  2. EJBTHREE-923

Avoid unnecessary passivation/activation callbacks for beans cached on remote nodes

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major Major
    • AS 4.2.0 GA
    • AS 4.2.0 GA
    • Clustering
    • None

      Talking here about backup copy of an SFSB context on a remote node; i.e. not the instance on the node where the client is actively using it. Such a context's bean instance, interceptors and XPCs are still marshalled from replication, as they don't need to be unmarshalled unless used

      Two issues:

      1) If the context has been passivated to disk, and another replication of the context occurs, the old copy of the context will be read from disk before the new copy overwrites it. That's standard JBC behavior. Currently we are invoking @PostActivate on this old copy, and then immediately replacing it in the cache with the new copy. This @PostActivate call is unnecessary and forces an unneeded unmarshalling of the old context.

      2) If the replicated context is in memory, and the local eviction thread decides to passivate it, we are calling @PrePassivate on the bean. This is unnecessary when the bean is fully marshalled; a fully marshalled bean can't be holding any state that needs cleanup.

            bstansbe@redhat.com Brian Stansberry
            bstansbe@redhat.com Brian Stansberry
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: