Uploaded image for project: 'Commons Pool'
  1. Commons Pool
  2. POOL-22

GenericObjectPool.setMaxActive(0) allows an infinite number of instances

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.2
    • 1.3
    • None
    • Operating System: other
      Platform: Other

    • 29863

    Description

      This behaviour is documented for negative values but not for zero.
      Pool 1.0 & 1.0.1 both implemented the documented behaviour.

      The issue was introduced here:
      http://cvs.apache.org/viewcvs.cgi/jakarta-commons/pool/src/java/org/apache/commons/pool/impl/GenericObjectPool.java?r1=1.6&r2=1.7&diff_format=h

      The fix is simple, change:
      (_maxActive <= 0 || _numActive < _maxActive)
      to:
      (_maxActive < 0 || _numActive < _maxActive)

      Attachments

        Activity

          People

            Unassigned Unassigned
            dirkv Dirk Verbeeck
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: