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
This commit is contained in:
Andrew Hind
2011-12-14 17:09:45 +00:00
parent 56d340c4ba
commit b78b070bae

View File

@@ -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(),