mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Fixed ALF-4682: ActionTrackingService uses cluster-unsafe cache
- Added *full* replication of objects across the cluster for 'executingActionsCache' - Changed cache variables to use SimpleCache git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@22387 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -118,8 +118,7 @@
|
||||
<ref bean="actionService" />
|
||||
</property>
|
||||
<property name="executingActionsCache">
|
||||
<!-- TODO: ALF-4682 ActionTrackingService uses cluster- and transactionally-unsafe cache -->
|
||||
<ref bean="executingActionsSharedCache" />
|
||||
<ref bean="executingActionsCache" />
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
|
@@ -1074,7 +1074,7 @@
|
||||
|
||||
<!-- The cross-transaction shared cache for Executing Actions -->
|
||||
|
||||
<bean name="executingActionsSharedCache" class="org.alfresco.repo.cache.EhCacheAdapter">
|
||||
<bean name="executingActionsCache" class="org.alfresco.repo.cache.EhCacheAdapter">
|
||||
<property name="cache">
|
||||
<bean class="org.springframework.cache.ehcache.EhCacheFactoryBean" >
|
||||
<property name="cacheManager">
|
||||
@@ -1087,18 +1087,4 @@
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!-- The transactional cache for Executing Actions -->
|
||||
|
||||
<bean name="executingActionsCache" class="org.alfresco.repo.cache.TransactionalCache">
|
||||
<property name="sharedCache">
|
||||
<ref bean="executingActionsSharedCache" />
|
||||
</property>
|
||||
<property name="name">
|
||||
<value>org.alfresco.cache.executingActionsTransactionalCache</value>
|
||||
</property>
|
||||
<property name="maxCacheSize">
|
||||
<value>1000</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
|
@@ -838,10 +838,10 @@
|
||||
|
||||
<cacheEventListenerFactory
|
||||
class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"
|
||||
properties="replicatePuts = false,
|
||||
properties="replicatePuts = true,
|
||||
replicateUpdates = true,
|
||||
replicateRemovals = true,
|
||||
replicateUpdatesViaCopy = false,
|
||||
replicateUpdatesViaCopy = true,
|
||||
replicateAsynchronously = false"/>
|
||||
|
||||
</cache>
|
||||
|
@@ -33,7 +33,7 @@ import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.action.ActionServiceImplTest.CancellableSleepAction;
|
||||
import org.alfresco.repo.action.ActionServiceImplTest.SleepActionExecuter;
|
||||
import org.alfresco.repo.action.executer.MoveActionExecuter;
|
||||
import org.alfresco.repo.cache.EhCacheAdapter;
|
||||
import org.alfresco.repo.cache.SimpleCache;
|
||||
import org.alfresco.repo.content.MimetypeMap;
|
||||
import org.alfresco.repo.jscript.ClasspathScriptLocation;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
@@ -69,6 +69,7 @@ public class ActionTrackingServiceImplTest extends TestCase
|
||||
private NodeRef rootNodeRef;
|
||||
|
||||
private NodeRef nodeRef;
|
||||
@SuppressWarnings("unused")
|
||||
private NodeRef folder;
|
||||
private NodeService nodeService;
|
||||
private ActionService actionService;
|
||||
@@ -76,7 +77,7 @@ public class ActionTrackingServiceImplTest extends TestCase
|
||||
private TransactionService transactionService;
|
||||
private RuntimeActionService runtimeActionService;
|
||||
private ActionTrackingService actionTrackingService;
|
||||
private EhCacheAdapter<String, ExecutionDetails> executingActionsCache;
|
||||
private SimpleCache<String, ExecutionDetails> executingActionsCache;
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -87,7 +88,7 @@ public class ActionTrackingServiceImplTest extends TestCase
|
||||
this.runtimeActionService = (RuntimeActionService)ctx.getBean("actionService");
|
||||
this.actionTrackingService = (ActionTrackingService)ctx.getBean("actionTrackingService");
|
||||
this.transactionService = (TransactionService)ctx.getBean("transactionService");
|
||||
this.executingActionsCache = (EhCacheAdapter<String, ExecutionDetails>)ctx.getBean("executingActionsSharedCache");
|
||||
this.executingActionsCache = (SimpleCache<String, ExecutionDetails>)ctx.getBean("executingActionsCache");
|
||||
|
||||
AuthenticationUtil.setRunAsUserSystem();
|
||||
|
||||
@@ -117,9 +118,7 @@ public class ActionTrackingServiceImplTest extends TestCase
|
||||
txn.commit();
|
||||
|
||||
// Cache should start empty each time
|
||||
for(String key : executingActionsCache.getKeys()) {
|
||||
executingActionsCache.remove(key);
|
||||
}
|
||||
executingActionsCache.clear();
|
||||
|
||||
// Reset the execution instance IDs, so we
|
||||
// can predict what they'll be
|
||||
|
Reference in New Issue
Block a user