Port fix for bug 40844. Missing syncs.
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 19 Nov 2006 23:52:52 +0000 (23:52 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 19 Nov 2006 23:52:52 +0000 (23:52 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@476979 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/realm/JDBCRealm.java
webapps/docs/changelog.xml

index df1b56d..e53bddc 100644 (file)
@@ -39,7 +39,8 @@ import org.apache.catalina.util.StringManager;
 * for configuration options.
 *
 * <p><strong>TODO</strong> - Support connection pooling (including message
-* format objects) so that <code>authenticate()</code> does not have to be
+* format objects) so that <code>authenticate()</code>,
+* <code>getPassword()</code> and <code>authenticate()</code> do not have to be
 * synchronized and would fix the ugly connection logic. </p>
 *
 * @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) {
index 05dd2ef..0e1b3e1 100644 (file)
   </properties>
 
 <body>
+<section name="Tomcat 6.0.3 (remm)">
+  <subsection name="General">
+    <changelog>
+    </changelog>
+  </subsection>
+  <subsection name="Catalina">
+    <changelog>
+      <fix>
+        <bug>40844</bug> Missing syncs in JDBCRealm. (markt)
+      </fix>
+    </changelog>
+  </subsection>
+  <subsection name="Coyote">
+    <changelog>
+    </changelog>
+  </subsection> 
+</section>
 <section name="Tomcat 6.0.2 (remm)">
   <subsection name="General">
     <changelog>