Commons Dbcp
  1. Commons Dbcp
  2. DBCP-41

[dbcp][patch] docs lie: NOT maxIdle = 0 for no limit BUT -1

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.2
    • Fix Version/s: 1.3
    • Labels:
      None
    • Environment:

      Operating System: other
      Platform: Other

      Description

      Documnentation for BasicDataSource and in a number of other places say: setMaxIdle( 0 ) for no limit. But GenericObjectPool says that negative (-1 for instance) should be used for this purpose.

      In our neighbour project developers tried 0 and pool appeared to be non-functional: a new connection was created each time. They said: oh, well, drop dbcp, it does not work!

      I consider this doc update so critical that I'm submitting a patch.

        Issue Links

          Activity

          Anton Tagunov created issue -
          Hide
          Anton Tagunov added a comment -

          Created an attachment (id=15558)
          set maxIdle to negative value for no limit on idle connections

          Show
          Anton Tagunov added a comment - Created an attachment (id=15558) set maxIdle to negative value for no limit on idle connections
          Hide
          Anton Tagunov added a comment -

          Created an attachment (id=15560)
          fixed patch

          The patch contains exactly one code (not doc) fix:

          DriverAdapterCPDS.java
          if (isPoolPreparedStatements()) {

          • if (getMaxPreparedStatements() == -1)
            + if (getMaxPreparedStatements() <= 0)
            {
            // since there is no limit

          As docs now says that "non-positive" maxPreparedStatements stands for "no
          limit", and since this is the semantics of maxTotal in GenericKeyedObjectPool
          (where _maxPreparedStatements ends in) I think it is appropriate to change code
          like this.

          Sorry, my prev version of patch was in error at this exactly place.

          Show
          Anton Tagunov added a comment - Created an attachment (id=15560) fixed patch The patch contains exactly one code (not doc) fix: DriverAdapterCPDS.java if (isPoolPreparedStatements()) { if (getMaxPreparedStatements() == -1) + if (getMaxPreparedStatements() <= 0) { // since there is no limit As docs now says that "non-positive" maxPreparedStatements stands for "no limit", and since this is the semantics of maxTotal in GenericKeyedObjectPool (where _maxPreparedStatements ends in) I think it is appropriate to change code like this. Sorry, my prev version of patch was in error at this exactly place.
          Henri Yandell made changes -
          Field Original Value New Value
          issue.field.bugzillaimportkey 35542 12342344
          Anonymous made changes -
          Link This issue blocks COM-2193 [ COM-2193 ]
          Henri Yandell made changes -
          Component/s Dbcp [ 12311109 ]
          Key COM-2192 DBCP-41
          Assignee Jakarta Commons Developers Mailing List [ commons-dev@jakarta.apache.org ]
          Project Commons [ 12310458 ] Commons Dbcp [ 12310469 ]
          Affects Version/s unspecified [ 12311647 ]
          Phil Steitz made changes -
          Affects Version/s 1.2.2 [ 12311976 ]
          Bugzilla Id 35542
          Phil Steitz made changes -
          Fix Version/s 1.2.2 [ 12311976 ]
          Affects Version/s 1.2.2 [ 12311976 ]
          Affects Version/s 1.2.1 [ 12311975 ]
          Bugzilla Id 35542
          Hide
          Phil Steitz added a comment -

          Patch applied. Thanks.

          Show
          Phil Steitz added a comment - Patch applied. Thanks.
          Phil Steitz made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Hide
          Phil Steitz added a comment -

          The patch applied in r427015 should not have changed the description for maxActive.

          Show
          Phil Steitz added a comment - The patch applied in r427015 should not have changed the description for maxActive.
          Phil Steitz made changes -
          Status Resolved [ 5 ] Reopened [ 4 ]
          Resolution Fixed [ 1 ]
          Hide
          Phil Steitz added a comment -

          maxActive documentation error applies to 1.2.2 configuration.xml. Javadoc for BasicDataSource also needs to be fixed.

          Show
          Phil Steitz added a comment - maxActive documentation error applies to 1.2.2 configuration.xml. Javadoc for BasicDataSource also needs to be fixed.
          Phil Steitz made changes -
          Affects Version/s 1.2.2 [ 12311976 ]
          Affects Version/s 1.2.1 [ 12311975 ]
          Phil Steitz made changes -
          Fix Version/s 1.2.2 [ 12311976 ]
          Fix Version/s 1.3 [ 12311977 ]
          Phil Steitz made changes -
          Resolution Fixed [ 1 ]
          Status Reopened [ 4 ] Resolved [ 5 ]
          Henri Yandell made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Gavin made changes -
          Link This issue blocks POOL-33 [ POOL-33 ]
          Gavin made changes -
          Link This issue is depended upon by POOL-33 [ POOL-33 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Resolved Resolved
          396d 4h 47m 1 Phil Steitz 31/Jul/06 04:45
          Resolved Resolved Reopened Reopened
          586d 14h 43m 1 Phil Steitz 08/Mar/08 19:28
          Reopened Reopened Resolved Resolved
          3h 30m 1 Phil Steitz 08/Mar/08 22:59
          Resolved Resolved Closed Closed
          16d 9h 12m 1 Henri Yandell 25/Mar/08 08:11

            People

            • Assignee:
              Unassigned
              Reporter:
              Anton Tagunov
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development