mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Fixed ALF-10061: NodeService.getAssoc() throws an exception if the requested association does not exist
- CMIS expects to get null (as per NodeService javadoc) but it was generating a concurrency exception - Added a specific call to getNodeAssocOrNull to the DAO git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@30162 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1569,7 +1569,7 @@ public abstract class AbstractNodeDAOImpl implements NodeDAO, BatchingDAO
|
||||
{
|
||||
// Disable all behaviour.
|
||||
// This only affects cm:auditable and is discarded at the end of this txn
|
||||
policyBehaviourFilter.disableAllBehaviours();
|
||||
policyBehaviourFilter.disableBehaviour();
|
||||
// Tag the transaction to prevent further propagation
|
||||
AlfrescoTransactionSupport.bindResource(KEY_AUDITABLE_PROPAGATION_DISABLE, Boolean.TRUE);
|
||||
|
||||
@@ -2506,16 +2506,33 @@ public abstract class AbstractNodeDAOImpl implements NodeDAO, BatchingDAO
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
public Pair<Long, AssociationRef> getNodeAssoc(Long assocId)
|
||||
|
||||
@Override
|
||||
public Pair<Long, AssociationRef> getNodeAssocOrNull(Long assocId)
|
||||
{
|
||||
NodeAssocEntity nodeAssocEntity = selectNodeAssocById(assocId);
|
||||
if (nodeAssocEntity == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
AssociationRef assocRef = nodeAssocEntity.getAssociationRef(qnameDAO);
|
||||
return new Pair<Long, AssociationRef>(assocId, assocRef);
|
||||
}
|
||||
}
|
||||
|
||||
public Pair<Long, AssociationRef> getNodeAssoc(Long assocId)
|
||||
{
|
||||
Pair<Long, AssociationRef> ret = getNodeAssocOrNull(assocId);
|
||||
if (ret == null)
|
||||
{
|
||||
throw new ConcurrencyFailureException("Assoc ID does not point to a valid association: " + assocId);
|
||||
}
|
||||
AssociationRef assocRef = nodeAssocEntity.getAssociationRef(qnameDAO);
|
||||
return new Pair<Long, AssociationRef>(assocId, assocRef);
|
||||
else
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user