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

Allow subclasses of BasicDataSource to provide their own GenericObjectPool implementation

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.1
    • Fix Version/s: 2.2.0
    • Labels:
      None

      Description

      I had the same need in an older version and I had to do a terrible hack which I would not like to do with a newer version.

      The main idea is that I would like to be able to monitor borrow and return events (among other things) and for that I need to provide my own GenericObjectPool implementation.

      It would be a small change to add a createObjectPool method and use it in createConnectionPool. Default implementation would be to

      if (abandonedConfig != null &&
                      (abandonedConfig.getRemoveAbandonedOnBorrow() ||
                       abandonedConfig.getRemoveAbandonedOnMaintenance())) {
                  gop = new GenericObjectPool<>(factory, config, abandonedConfig);
              }
              else {
                  gop = new GenericObjectPool<>(factory, config);
              }
      

      Subclasses would have the flexibility to provide their own pool implementation.

        Attachments

        1. DBCP-458.patch
          2 kB
          Adrian Tarau

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              adrian.tarau Adrian Tarau
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: