You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2018/06/10 18:38:40 UTC
commons-dbcp git commit: Comments.
Repository: commons-dbcp
Updated Branches:
refs/heads/master 8fb9b82b1 -> fe71bba6f
Comments.
Project: http://git-wip-us.apache.org/repos/asf/commons-dbcp/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-dbcp/commit/fe71bba6
Tree: http://git-wip-us.apache.org/repos/asf/commons-dbcp/tree/fe71bba6
Diff: http://git-wip-us.apache.org/repos/asf/commons-dbcp/diff/fe71bba6
Branch: refs/heads/master
Commit: fe71bba6f74ce54fd2581af15db777772d7d7be2
Parents: 8fb9b82
Author: Gary Gregory <ga...@gmail.com>
Authored: Sun Jun 10 12:38:38 2018 -0600
Committer: Gary Gregory <ga...@gmail.com>
Committed: Sun Jun 10 12:38:38 2018 -0600
----------------------------------------------------------------------
.../dbcp2/datasources/InstanceKeyDataSource.java | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-dbcp/blob/fe71bba6/src/main/java/org/apache/commons/dbcp2/datasources/InstanceKeyDataSource.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/dbcp2/datasources/InstanceKeyDataSource.java b/src/main/java/org/apache/commons/dbcp2/datasources/InstanceKeyDataSource.java
index e96779d..9dd7948 100644
--- a/src/main/java/org/apache/commons/dbcp2/datasources/InstanceKeyDataSource.java
+++ b/src/main/java/org/apache/commons/dbcp2/datasources/InstanceKeyDataSource.java
@@ -925,9 +925,8 @@ public abstract class InstanceKeyDataSource implements DataSource, Referenceable
throw new SQLException("Cannot borrow connection from pool", e);
}
- if (!(null == password ? null == info.getPassword() : password.equals(info.getPassword()))) { // Password on
- // PooledConnectionAndInfo
- // does not match
+ // Password on PooledConnectionAndInfo does not match
+ if (!(null == password ? null == info.getPassword() : password.equals(info.getPassword()))) {
try { // See if password has changed by attempting connection
testCPDS(userName, password);
} catch (final SQLException ex) {
@@ -944,9 +943,10 @@ public abstract class InstanceKeyDataSource implements DataSource, Referenceable
*/
final UserPassKey upkey = info.getUserPassKey();
final PooledConnectionManager manager = getConnectionManager(upkey);
- manager.invalidate(info.getPooledConnection()); // Destroy and remove from pool
- manager.setPassword(upkey.getPassword()); // Reset the password on the factory if using
- // CPDSConnectionFactory
+ // Destroy and remove from pool
+ manager.invalidate(info.getPooledConnection());
+ // Reset the password on the factory if using CPDSConnectionFactory
+ manager.setPassword(upkey.getPassword());
info = null;
for (int i = 0; i < 10; i++) { // Bound the number of retries - only needed if bad instances return
try {