Reverse Merge:

MNT-15135 "Alfresco Media Management: Rendition Concurrency Failure on Property update"

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@130769 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Steven Glover
2016-09-19 10:23:19 +00:00
parent 913e231f7c
commit a11c8778e9
6 changed files with 583 additions and 1229 deletions

View File

@@ -265,8 +265,8 @@ public class ThumbnailServiceImpl implements ThumbnailService,
if (logger.isDebugEnabled())
{
logger.debug("Thumbnail created " + childAssoc + " for sourceNodeRef " + sourceNodeRef + ", thumbnail "
+ thumbnailName + ", thumbnailNodeRef " + thumbnailNodeRef);
logger.debug("Thumbnail created " + childAssoc + " for sourceNodeRef " + sourceNodeRef + ", thumbnail " + thumbnailName
+ ", thumbnailNodeRef " + thumbnailNodeRef);
}
// MNT-15135: Cache the associations between parent nodes and updated thumbnails,
@@ -382,12 +382,6 @@ public class ThumbnailServiceImpl implements ThumbnailService,
//We can be in a read-only transaction, so force a new transaction
requiresNew = true;
}
// Get the name of the thumbnail and add to properties map
QName thumbnailQName = getThumbnailQName(thumbnailName);
final RenditionDefinition definition = createRenditionDefinition(contentProperty, mimetype,
transformationOptions, thumbnailQName, assocDetails);
return txnHelper.doInTransaction(new RetryingTransactionCallback<NodeRef>()
{
@@ -398,12 +392,18 @@ public class ThumbnailServiceImpl implements ThumbnailService,
{
public NodeRef doWork() throws Exception
{
return createThumbnailNode(node, definition, thumbnailName);
return createThumbnailNode( node,
contentProperty,
mimetype,
transformationOptions,
thumbnailName,
assocDetails);
}
}, AuthenticationUtil.getSystemUserName());
}
}, false, requiresNew);
}
private QName getThumbnailQName(String localThumbnailName)
@@ -717,8 +717,14 @@ public class ThumbnailServiceImpl implements ThumbnailService,
return definition;
}
private NodeRef createThumbnailNode(final NodeRef node, final RenditionDefinition definition, final String thumbnailName)
private NodeRef createThumbnailNode(final NodeRef node, final QName contentProperty,
final String mimetype, final TransformationOptions transformationOptions, final String thumbnailName,
final ThumbnailParentAssociationDetails assocDetails)
{
// Get the name of the thumbnail and add to properties map
QName thumbnailQName = getThumbnailQName(thumbnailName);
RenditionDefinition definition = createRenditionDefinition(contentProperty, mimetype,
transformationOptions, thumbnailQName, assocDetails);
try
{
ChildAssociationRef thumbnailAssoc = renditionService.render(node, definition);