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

StrictMaxPool does not maintain a correct "inUse" count leading to incorrect reporting of "AvailableCount"

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 1.1.7
    • 1.1.6
    • core
    • None
    • jboss-ejb3-core:1.1.7

    Description

      The org.jboss.ejb3.test.stateless.unit.MetricsUnitTestCase shows a failure w.r.t the "AvailableCount" of a bean marked with StrictMaxPool.

      The StrictMaxPool internally implements the getAvailableCount() as follows:

      public int getAvailableCount()

      { return maxSize - inUse; }

      The "inUse" count is handled incorrectly in the discard and remove method of this pool leading to that count reaching a negative value. Ultimately, this leads to incorrect available count being reported.

      When an exception occurs, the bean is discarded from the pool. This leads to a call on discard method of the StrictMaxPool which decrements the inUse count and then calls the remove method which again decrements the inUse count for the same bean context.

      Attachments

        Activity

          People

            jaikiran Jaikiran Pai (Inactive)
            jaikiran Jaikiran Pai (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: