среда, 1 сентября 2010 г.

Authentication problems in multithreading

In my application, I have a tree widget that using ajax for loading nodes. Tomcat create some threads to service requests. Each requests validate security ticket that stores in http session:

authenticationService.validate(ticket, null);

And some threads can not validate this ticket and service throws AuthenticationException. If you have particular problem, then you should look at alfresco's jira: ALF-3789. This bug was fixed in revision 21065 at trunk. To fix it in my code, I simple override bean:

<!--Override alfresco-->
    <bean name="ticketsCache" class="org.alfresco.repo.cache.EhCacheAdapter">
       <property name="cache">
          <bean class="org.springframework.cache.ehcache.EhCacheFactoryBean" >
             <property name="cacheManager">
                <ref bean="internalEHCacheManager" />
             </property>
             <property name="cacheName">
                <value>org.alfresco.cache.ticketsCache</value>
             </property>
          </bean>
       </property>
    </bean>

After this all works fine :)

Комментариев нет:

Most popular

Authors