[ 
https://issues.apache.org/jira/browse/SHIRO-379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13457732#comment-13457732
 ] 

Jono Morris edited comment on SHIRO-379 at 9/18/12 9:41 PM:
------------------------------------------------------------

Please find attached a diff that adds a lock to the SimpleAccountRealm for 
mutual exclusion.
                
      was (Author: jono_morris):
    Adds a lock to SimpleAccountRealm for mutual exclusion
                  
> SimpleAccoutRealm concurrency access to roles and users
> -------------------------------------------------------
>
>                 Key: SHIRO-379
>                 URL: https://issues.apache.org/jira/browse/SHIRO-379
>             Project: Shiro
>          Issue Type: Bug
>          Components: Realms 
>    Affects Versions: 1.2.0
>         Environment: Apache Tomcat 6.0.35, Win 7 x64, JDK 1.6.0_32 x64
>            Reporter: Ludovic Garcia
>            Priority: Minor
>         Attachments: shiro_379.diff
>
>
> I'm using a PropertiesRealm which automatically reload Users and roles if the 
> resource has been modified.
> And i noticed that authenticating an user and reloading properties file in 
> the same time, authenticating do not wait for reloading to be finished. 
> Should not SimpleAccountRealm be refactored in order to lock authentication 
> while modifying users / roles?
> We should simply acquire a Mutex in order to retrieve users / roles or adding 
> / removing users?
> An other way to ensure concurrency should be to use 
> Collections.synchronizedMap() for users' map and roles' map, but while 
> reloading resource, authentications won't wait for the reloading to be 
> finished.
> I can do required changes if it helps 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to