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

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

    XMLWordPrintableJSON

Details

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

    • 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

            Unassigned Unassigned
            rlenard Rohan Lenard
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: