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

PerUserPoolDataSource.getPooledConnectionAndInfo multi-threading bug

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • None

    Description

      PerUserPoolDataSource.getPooledConnectionAndInfo(user,pass) has the code:

      Object pool = pools.get(key); // (1) pools = instance variable
      synchronized(this) {
          if (pool == null) {
              try {
                  registerPool(username, password);
                  pool = pools.get(key);
      [...]
      

      The first get() call can return null to multiple threads, so multiple threads can register the pool.
      This allows more than maxActive() connections to be returned.

      Attachments

        Activity

          People

            Unassigned Unassigned
            sebb Sebb
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: