Merged DEV to HEAD

51998: Deleting a store is now functionally the same as deleting a node but without any option of archival
          - ALF-19153: CLOUD-1685, CLOUD-1827 and CLOUD-1828
          - While cleaning Cloud test data tenants are deleted, which leads to their stores being deleted.
          - NodeService.deleteStore was not firing policies for every node in the store; several bits of pre- and
            post-delete code were therefore not being called, which lead to secondary data (caches, attributes, etc)
            being left lying around.
          - A side effect of this fix was that the sys:undeletable aspect has to be disabled during account deletion


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@52007 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2013-07-02 16:21:08 +00:00
parent ab68f2d503
commit 75359375b8
5 changed files with 72 additions and 5 deletions

View File

@@ -850,6 +850,11 @@ public abstract class AbstractNodeDAOImpl implements NodeDAO, BatchingDAO
{
throw new ConcurrencyFailureException("Store not updated: " + oldStoreRef);
}
// Bring all the associated nodes into the current transaction
Long txnId = getCurrentTransaction().getId();
Long storeId = store.getId();
updateNodesInStore(txnId, storeId);
// All the NodeRef-based caches are invalid. ID-based caches are fine.
rootNodesCache.removeByKey(oldStoreRef);
allRootNodesCache.remove(oldStoreRef);
@@ -4827,6 +4832,7 @@ public abstract class AbstractNodeDAOImpl implements NodeDAO, BatchingDAO
protected abstract Long insertStore(StoreEntity store);
protected abstract int updateStoreRoot(StoreEntity store);
protected abstract int updateStore(StoreEntity store);
protected abstract int updateNodesInStore(Long txnId, Long storeId);
protected abstract Long insertNode(NodeEntity node);
protected abstract int updateNode(NodeUpdateEntity nodeUpdate);
protected abstract int updateNodes(Long txnId, List<Long> nodeIds);