Commons Dbcp
  1. Commons Dbcp
  2. DBCP-245

SharedPoolDataSource saves wrong password forever

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.1, 1.2, 1.2.1, 1.2.2
    • Fix Version/s: 1.3
    • Labels:
      None
    • Environment:

      Description

      The SharedPoolDataSource saves wrong password forever

      1. Get a connection for user1 (use username of user1 and password of user1) ---> connection ok
      2. Get a connection for user2 (use username of user2 and a wrong password) --> connection failed
      3. Get a connection for user2 (use username of user2 and password of user2) --> connection will be failed too because the wrong password is stored in the usersKey map.

      Bugfix
      ===================================================================

      protected synchronized PooledConnectionAndInfo
      getPooledConnectionAndInfo(String username, String password)
      throws SQLException {
      if (pool == null) {
      try

      { registerPool(username, password); }

      catch (NamingException e)

      { throw new SQLNestedException("RegisterPool failed", e); }

      }

      PooledConnectionAndInfo info = null;
      UserPassKey userPassKey = null;
      try

      { userPassKey = getUserPassKey(username, password); info = (PooledConnectionAndInfo) pool .borrowObject(userPassKey); }

      catch (Exception e) {

      if (userKeys != null && userKeys.containsKey(username))

      { userKeys.remove(username); }

      throw new SQLNestedException(
      "Could not retrieve connection info from pool", e);
      }
      return info;
      }

        Activity

        Michael Drechsel created issue -
        Phil Steitz made changes -
        Field Original Value New Value
        Affects Version/s 1.1 [ 12311719 ]
        Affects Version/s 1.2 [ 12311721 ]
        Affects Version/s 1.2.1 [ 12311975 ]
        Fix Version/s 1.3 [ 12311977 ]
        Phil Steitz made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Henri Yandell made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Michael Drechsel
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development