mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Fix for ALF-10842
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@31673 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1495,6 +1495,7 @@ public abstract class AbstractNodeDAOImpl implements NodeDAO, BatchingDAO
|
||||
invalidateNodePropertiesCache,
|
||||
invalidateParentAssocsCache);
|
||||
}
|
||||
|
||||
return updatedNode;
|
||||
}
|
||||
|
||||
@@ -2337,12 +2338,17 @@ public abstract class AbstractNodeDAOImpl implements NodeDAO, BatchingDAO
|
||||
Set<QName> newAspectQNames = new HashSet<QName>(existingAspectQNames);
|
||||
newAspectQNames.addAll(aspectQNamesToAdd);
|
||||
setNodeAspectsCached(nodeId, newAspectQNames);
|
||||
|
||||
|
||||
if (aspectQNamesToAdd.contains(ContentModel.ASPECT_ROOT))
|
||||
{
|
||||
// This is a special case. The presence of the aspect affects the path
|
||||
// calculations, which are stored in the parent assocs cache
|
||||
touchNode(nodeId, null, false, false, true);
|
||||
|
||||
// invalidate root nodes cache for the store
|
||||
Pair<Long, NodeRef> nodePair = getNodePair(nodeId);
|
||||
StoreRef storeRef = nodePair.getSecond().getStoreRef();
|
||||
allRootNodesCache.remove(storeRef);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2384,14 +2390,29 @@ public abstract class AbstractNodeDAOImpl implements NodeDAO, BatchingDAO
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// Manually update the cache
|
||||
Set<QName> newAspectQNames = new HashSet<QName>(existingAspectQNames);
|
||||
newAspectQNames.removeAll(aspectQNames);
|
||||
setNodeAspectsCached(nodeId, newAspectQNames);
|
||||
|
||||
// Touch the node; all caches are fine
|
||||
touchNode(nodeId, null, false, false, false);
|
||||
// If we are removing the sys:aspect_root, then the parent assocs cache is unreliable
|
||||
if (aspectQNames.contains(ContentModel.ASPECT_ROOT))
|
||||
{
|
||||
// This is a special case. The presence of the aspect affects the path
|
||||
// calculations, which are stored in the parent assocs cache
|
||||
touchNode(nodeId, null, false, false, true);
|
||||
|
||||
// invalidate root nodes cache for the store
|
||||
Pair<Long, NodeRef> nodePair = getNodePair(nodeId);
|
||||
StoreRef storeRef = nodePair.getSecond().getStoreRef();
|
||||
allRootNodesCache.remove(storeRef);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Touch the node; all caches are fine
|
||||
touchNode(nodeId, null, false, false, false);
|
||||
}
|
||||
|
||||
// Done
|
||||
return deleteCount > 0;
|
||||
|
Reference in New Issue
Block a user