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

StatefulTreeCache should abort passivation if bean tree is in use

XMLWordPrintable

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

      Passivation of the parent context that holds nested beans should not occur if any of the beans are in use. The potential that child beans are in use while the parent is not increases the possibility that the passivation thread will attempt to passivate an in-use context.

      To deal with this, StatefulTreeCache will listen for prePassivate events and check whether any bean in the context's tree is in use. If it is, a custom RuntimeException will be thrown in order to abort the passivation.

      The cache will use a special LRUPolicy subclass that will recognize the custom exception and not log an error for it, just retrying the passivation on the next run of the eviction thread. (The standard LRUPolicy will retry, but will log an ERROR if an exception is caught. We don't want any error logged, as this is not an unexpected situation.)

            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: