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

PoolableConnectionFactory.validateConnection() doesn't test connection.isValid()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • None
    • None
    • None

    Description

      On my environment, we sometimes get notified that something was changed on the DB servers (servers added/removed from the pool, master/slave promotion, etc).

      In these cases, we want to discard all existing connections in the pool and let it create new ones with the updated configuration.

      My initial idea is to have existing Connections returning isValid() == false after these events.
      But, after lots of debugging, it turns out that having the connection.isValid() returning false doesn't make it go away from the connection pool, since it is never checked.

      Fixing it would be very simple, and I can send you the patch, but I don't know if there is any reason it was left out in the first place, or if it would cause compatibility issues (Probably not).

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              paulo_raca Paulo Costa
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 24h
                  24h
                  Remaining:
                  Remaining Estimate - 24h
                  24h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified