From 837608d8f35cdbc75bdbbe31dea4067e8b6b0285 Mon Sep 17 00:00:00 2001 From: Derek Hulley Date: Wed, 21 Oct 2009 22:26:21 +0000 Subject: [PATCH] For for InMemoryTicketComponent, which iterates over the keys in the cache - The root issue is that some entries are null markers - Cache entries could disappear during the iteration anyway - Cleaned up some comments in the cache code git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@17073 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../org/alfresco/repo/cache/TransactionalCache.java | 10 +--------- .../authentication/InMemoryTicketComponentImpl.java | 5 +++++ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/source/java/org/alfresco/repo/cache/TransactionalCache.java b/source/java/org/alfresco/repo/cache/TransactionalCache.java index 0857d5b23d..41999b6229 100644 --- a/source/java/org/alfresco/repo/cache/TransactionalCache.java +++ b/source/java/org/alfresco/repo/cache/TransactionalCache.java @@ -518,15 +518,7 @@ public class TransactionalCache // is the shared cache going to be cleared? if (txnData.isClearOn) { - // overflow about to occur or has occured - we can only guarantee non-stale - // data by clearing the shared cache after the transaction. Also, the - // shared cache needs to be ignored for the rest of the transaction. - txnData.isClearOn = true; - if (!txnData.haveIssuedFullWarning && logger.isWarnEnabled()) - { - logger.warn("Transactional update cache '" + name + "' is full (" + maxCacheSize + ")."); - txnData.haveIssuedFullWarning = true; - } + // don't store removals if we're just going to clear it all out later } else { diff --git a/source/java/org/alfresco/repo/security/authentication/InMemoryTicketComponentImpl.java b/source/java/org/alfresco/repo/security/authentication/InMemoryTicketComponentImpl.java index d35983edc1..53e6e2fc97 100644 --- a/source/java/org/alfresco/repo/security/authentication/InMemoryTicketComponentImpl.java +++ b/source/java/org/alfresco/repo/security/authentication/InMemoryTicketComponentImpl.java @@ -229,6 +229,11 @@ public class InMemoryTicketComponentImpl implements TicketComponent for (String key : ticketsCache.getKeys()) { Ticket ticket = ticketsCache.get(key); + // Hack: The getKeys() call might return keys for null marker objects, yielding null values + if (ticket == null) + { + continue; + } if (ticket.getUserName().equals(userName)) { toRemove.add(ticket.getTicketId());