Part of ALF-10699: Nodes not getting put into new transactions during various operations

- Mass ACL updates of primary children now update the version and transaction for the affected nodes


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@31108 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2011-10-11 03:07:30 +00:00
parent 916ef0cc06
commit e2b4f2884d
6 changed files with 63 additions and 10 deletions

View File

@@ -1565,7 +1565,12 @@ public abstract class AbstractNodeDAOImpl implements NodeDAO, BatchingDAO
Long optionalOldSharedAlcIdInAdditionToNull,
Long newSharedAclId)
{
updatePrimaryChildrenSharedAclId(primaryParentNodeId, optionalOldSharedAlcIdInAdditionToNull, newSharedAclId);
Long txnId = getCurrentTransactionId();
updatePrimaryChildrenSharedAclId(
txnId,
primaryParentNodeId,
optionalOldSharedAlcIdInAdditionToNull,
newSharedAclId);
invalidateCachesByNodeId(primaryParentNodeId, null, nodesCache);
}
@@ -3362,12 +3367,6 @@ public abstract class AbstractNodeDAOImpl implements NodeDAO, BatchingDAO
throw new DataIntegrityViolationException("Stale cache detected for Node #" + nodeId);
}
private ParentAssocsInfo getParentAssocsCacheOnly(Long nodeId)
{
// can be null
return parentAssocsCache.getValue(nodeId);
}
/**
* Update a node's parent associations.
*/
@@ -3848,6 +3847,7 @@ public abstract class AbstractNodeDAOImpl implements NodeDAO, BatchingDAO
protected abstract int updateNode(NodeUpdateEntity nodeUpdate);
protected abstract int updateNodePatchAcl(NodeUpdateEntity nodeUpdate);
protected abstract void updatePrimaryChildrenSharedAclId(
Long txnId,
Long primaryParentNodeId,
Long optionalOldSharedAlcIdInAdditionToNull,
Long newSharedAlcId);

View File

@@ -27,6 +27,7 @@ package org.alfresco.repo.domain.node;
*/
public class PrimaryChildrenAclUpdateEntity
{
Long txnId;
Long primaryParentNodeId;
Long optionalOldSharedAclIdInAdditionToNull;
Long newSharedAclId;
@@ -35,6 +36,16 @@ public class PrimaryChildrenAclUpdateEntity
{
}
public Long getTxnId()
{
return txnId;
}
public void setTxnId(Long txnId)
{
this.txnId = txnId;
}
public Long getPrimaryParentNodeId()
{
return primaryParentNodeId;

View File

@@ -326,11 +326,13 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
@Override
protected void updatePrimaryChildrenSharedAclId(
Long txnId,
Long primaryParentNodeId,
Long optionalOldSharedAlcIdInAdditionToNull,
Long newSharedAlcId)
{
PrimaryChildrenAclUpdateEntity primaryChildrenAclUpdateEntity = new PrimaryChildrenAclUpdateEntity();
primaryChildrenAclUpdateEntity.setTxnId(txnId);
primaryChildrenAclUpdateEntity.setPrimaryParentNodeId(primaryParentNodeId);
primaryChildrenAclUpdateEntity.setOptionalOldSharedAclIdInAdditionToNull(optionalOldSharedAlcIdInAdditionToNull);
primaryChildrenAclUpdateEntity.setNewSharedAclId(newSharedAlcId);