From b78b070baec9ef66b1993cfcf5754dcf49d2acaf Mon Sep 17 00:00:00 2001 From: Andrew Hind Date: Wed, 14 Dec 2011 17:09:45 +0000 Subject: [PATCH] Fix for ALF-10153 SQL Server: FK failures across various tests - added retry for two concurrency issues on adding children git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@32768 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../repo/domain/node/AbstractNodeDAOImpl.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/source/java/org/alfresco/repo/domain/node/AbstractNodeDAOImpl.java b/source/java/org/alfresco/repo/domain/node/AbstractNodeDAOImpl.java index 708cd04196..14d7364a5d 100644 --- a/source/java/org/alfresco/repo/domain/node/AbstractNodeDAOImpl.java +++ b/source/java/org/alfresco/repo/domain/node/AbstractNodeDAOImpl.java @@ -2793,6 +2793,18 @@ public abstract class AbstractNodeDAOImpl implements NodeDAO, BatchingDAO catch (Throwable e) { controlDAO.rollbackToSavepoint(savepoint); + // SQL Server retry + + if(e.getMessage().contains("Snapshot isolation transaction aborted")) + { + throw new ConcurrencyFailureException("SQL Server snapshot isolation retry...", e); + } + + if(e.getMessage().contains("The INSERT statement conflicted with the FOREIGN KEY constraint")) + { + throw new ConcurrencyFailureException("SQL Server FK conflict retry...", e); + } + // We assume that this is from the child cm:name constraint violation throw new DuplicateChildNodeNameException( parentNode.getNodeRef(),