Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud)

60652: Precautions against MNT-10486: NPE in NodeEntity during post-commit write through to shared cache
    - Ensure that NodeEntity objects are locked before going into cache (missed locks during bulk loading)
    - Do check on validity of NodeEntity during lock


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@62355 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2014-02-12 14:31:36 +00:00
parent c7ed0857ae
commit 32b92eb51b
2 changed files with 8 additions and 0 deletions

View File

@@ -1058,6 +1058,7 @@ public abstract class AbstractNodeDAOImpl implements NodeDAO, BatchingDAO
}
Long nodeId = dbNode.getId();
invalidateNodeCaches(nodeId);
dbNode.lock(); // Prevent unexpected edits of values going into the cache
nodesCache.setValue(nodeId, dbNode);
return dbNode.getNodePair();
}
@@ -1159,6 +1160,7 @@ public abstract class AbstractNodeDAOImpl implements NodeDAO, BatchingDAO
logger.debug("Repairing stale cache entry for node: " + nodeId);
}
invalidateNodeCaches(nodeId);
dbNode.lock(); // Prevent unexpected edits of values going into the cache
nodesCache.setValue(nodeId, dbNode);
return dbNode.getNodePair();
}
@@ -4632,6 +4634,7 @@ public abstract class AbstractNodeDAOImpl implements NodeDAO, BatchingDAO
{
Long nodeId = node.getId();
NodeVersionKey nodeVersionKey = node.getNodeVersionKey();
node.lock(); // Prevent unexpected edits of values going into the cache
nodesCache.setValue(nodeId, node);
if (propertiesCache.getValue(nodeVersionKey) == null)
{