tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 38596] New: - Unnecessary synchronization and garbage in DataSourceRealm
Date Thu, 09 Feb 2006 16:55:11 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38596>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38596

           Summary: Unnecessary synchronization and garbage in
                    DataSourceRealm
           Product: Tomcat 5
           Version: Nightly Build
          Platform: Other
               URL: http://svn.apache.org/repos/asf/tomcat/container/tc5.5.x
                    /catalina/src/share/org/apache/catalina/realm/DataSource
                    Realm.java
        OS/Version: All
            Status: NEW
          Severity: trivial
          Priority: P4
         Component: Catalina
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: Sandy@McArthur.org


DataSourceRealm.java declares two StringBuffers fields, preparedRoles and
preparedCredentials, that hold the SQL to be used. After these fields are
assigned they do not change but to use them StringBuffer.toString() must be
called. The toString method is synchronized and creates a new String instance
each time it's called.

The simple fix is to change those fields to Strings and update the start()
method, and remove the toString() calls in credentials(...) and roles(...) methods.

A better, more intrusive, fix is to take advantage of PreparedStatements like
JDBCRealm does.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


Mime
View raw message