From: markt Date: Sun, 19 Nov 2006 23:52:52 +0000 (+0000) Subject: Port fix for bug 40844. Missing syncs. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=cf4b43c96ce0cf50f34c098e2a3d41fdaef87a23;p=tomcat7.0 Port fix for bug 40844. Missing syncs. git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@476979 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/realm/JDBCRealm.java b/java/org/apache/catalina/realm/JDBCRealm.java index df1b56d98..e53bddc74 100644 --- a/java/org/apache/catalina/realm/JDBCRealm.java +++ b/java/org/apache/catalina/realm/JDBCRealm.java @@ -39,7 +39,8 @@ import org.apache.catalina.util.StringManager; * for configuration options. * *

TODO - Support connection pooling (including message -* format objects) so that authenticate() does not have to be +* format objects) so that authenticate(), +* getPassword() and authenticate() do not have to be * synchronized and would fix the ugly connection logic.

* * @author Craig R. McClanahan @@ -520,7 +521,7 @@ public class JDBCRealm /** * Return the password associated with the given principal's user name. */ - protected String getPassword(String username) { + protected synchronized String getPassword(String username) { // Look up the user's credentials String dbCredentials = null; @@ -725,7 +726,8 @@ public class JDBCRealm * * @exception SQLException if a database error occurs */ - protected PreparedStatement roles(Connection dbConnection, String username) + protected synchronized PreparedStatement roles(Connection dbConnection, + String username) throws SQLException { if (preparedRoles == null) { diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 05dd2ef79..0e1b3e1b2 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -14,6 +14,23 @@ +
+ + + + + + + + 40844 Missing syncs in JDBCRealm. (markt) + + + + + + + +