It's not clear how the fix can actually solve the problem even if two
JaasSecurityManager can be created for the same SecurityDomain, each with its
own TimedCahePolicy object
In order for this exception to occur, there must be some code calling
TimedCachePolicy.insert() inbetween outside a syn
One thing I forget to mention in the original post: we use a different policy
for our main application HSM, and multiple similar policy for other data
sources. We have multiple data sources in our application, all using the same
encrypted username/password.
1. Could this has anything to do with
1. No.
2. The TimedCache is created with thread-safe set to true, and the update is
done within a synchronized block holding the cache monitor. If the principal is
seen to already be in the cache the existing value is removed so its not clear
how a race condition can exist.
Are you using a cust
Scott,
Thanks for your help.
We are not using a custom cache or accessing the cache via JNDI. It's worth
noting that the hsm policy, which is used by the application to authenticate
Browser users, uses a custom principal and sets its principal via
SecurityAssociationValve.userPrincipal.set(myI
security\src\main\org\jboss\security\plugins\JaasSecurityManagerService.java
has the creation:
| /** This is the InvocationHandler callback for the Context interface
that
|was created by out getObjectInstance() method. All this does is
create
|a new TimedCache instan
Scott,
Given that TimedCachePolicy is created thread-safe, the code try to insert into
it are wrapped in synchronized block and it is always try to remove existing
entry with same principal before insertion, but we still got
IllegalStateException for "Attempt to insert duplicate entry", there m
I did find a race condition that needs to be synchronized in the
JaasSecurityManagerService which could result in this error. Really nothing to
do with where the data sources reside other than how this affects the timing
issues that cause the race condition.
http://jira.jboss.com/jira/browse/JB