Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-1663

unsetEntityContext not called for instances released from the pool

    XMLWordPrintable

Details

    Description

      When entity instances are discarded, according to EJB 2.1 unsetEntityContext()
      should be called (although, for some reason, this is not mentioned in Container
      Provider Responsibilities, section 10.5.2 makes it quite clear that bean
      providers may rely on unsetEntityContext() being called). As far as I can see
      (and have tested slightly), unsetEntityContext() is never called in JBoss.

      The problem can be seen in org.jboss.ejb.plugins.AbstractInstancePool.free():
      if the pool is full, nothing spectacular is done; the entity instance is simply
      left alone, which causes it to be GC at some time.

      I believe, this code should be in the method:

      // this already is there
      if (pool.size() < maxSize)

      { pool.addFirst(ctx); }

      // add something like this
      else

      { ctx.discard(); }

      Attachments

        Issue Links

          Activity

            People

              dandread1@redhat.com Dimitrios Andreadis
              huuskart Arto Huusko (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: