Uploaded image for project: 'Commons DBCP'
  1. Commons DBCP
  2. DBCP-113

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

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

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

      Operating System: other
      Platform: Other

    • Bugzilla Id:
      29832

      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

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              rlenard Rohan Lenard

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment