Commons Dbcp
  1. Commons Dbcp
  2. DBCP-113

Broken behaviour for BasicDataSource.setMaxActive(0)/setMaxIde(0)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.2
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      Operating System: other
      Platform: Other

      Description

      I wanted to make a datasource that fails on each attempt (for testing purposes).

      The way the pools are configured appears to be wrong because if I do this -

      final BasicDataSource ds = new BasicDataSource();
      ds.setDriverClassName(driverName);
      ds.setUrl(url);
      ds.setUsername(userName);
      ds.setPassword(passwd);
      ds.setMaxActive(0);
      ds.setMaxIdle(0);

      final Connection conn = ds.getConnection();

      I expect to get an SQL Exception about exhausted pool. Instead it just gives
      me a connection !!.

      There is a workaround - use a null driver name - but that is silly - it should
      be doing the right thing with the pool

        Activity

        Rohan Lenard created issue -
        Hide
        Dirk Verbeeck added a comment -
        Show
        Dirk Verbeeck added a comment - Issue fixed in commons-pool See: http://issues.apache.org/bugzilla/show_bug.cgi?id=29863
        Henri Yandell made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 29832 12341545
        Henri Yandell made changes -
        Component/s Dbcp [ 12311109 ]
        Assignee Jakarta Commons Developers Mailing List [ commons-dev@jakarta.apache.org ]
        Affects Version/s 1.2 Final [ 12311661 ]
        Key COM-1393 DBCP-113
        Project Commons [ 12310458 ] Commons Dbcp [ 12310469 ]
        Henri Yandell made changes -
        Affects Version/s 1.2 Final [ 12311721 ]
        Henri Yandell made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

        Error rendering 'com.atlassian.jirafisheyeplugin:fisheye-issuepanel'. Please contact your JIRA administrators.

          People

          • Assignee:
            Unassigned
            Reporter:
            Rohan Lenard
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development