You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2008/07/29 16:58:06 UTC

svn commit: r680725 - /tomcat/trunk/java/org/apache/catalina/realm/JDBCRealm.java

Author: markt
Date: Tue Jul 29 07:58:05 2008
New Revision: 680725

URL: http://svn.apache.org/viewvc?rev=680725&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=45453
Add yet more synchronisation to JDBCRealm.
Based on a patch provided by Santtu Hyrkk.

Modified:
    tomcat/trunk/java/org/apache/catalina/realm/JDBCRealm.java

Modified: tomcat/trunk/java/org/apache/catalina/realm/JDBCRealm.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/realm/JDBCRealm.java?rev=680725&r1=680724&r2=680725&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/realm/JDBCRealm.java (original)
+++ tomcat/trunk/java/org/apache/catalina/realm/JDBCRealm.java Tue Jul 29 07:58:05 2008
@@ -38,10 +38,11 @@
 * See the JDBCRealm.howto for more details on how to set up the database and
 * for configuration options.
 *
-* <p><strong>TODO</strong> - Support connection pooling (including message
-* 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>
+* <p>For a <b>Realm</b> implementation that supports connection pooling and
+* doesn't require synchronisation of <code>authenticate()</code>,
+* <code>getPassword()</code>, <code>roles()</code> and
+* <code>getPrincipal()</code> or the ugly connection logic use the
+* <code>DataSourceRealm</code>.</p>
 *
 * @author Craig R. McClanahan
 * @author Carson McDonald
@@ -591,7 +592,7 @@
     /**
      * Return the Principal associated with the given user name.
      */
-    protected Principal getPrincipal(String username) {
+    protected synchronized Principal getPrincipal(String username) {
 
         return (new GenericPrincipal(this,
                                      username,



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org