From 316924e8de9e554576885ecf9de0d09fa1ec9324 Mon Sep 17 00:00:00 2001 From: Derek Hulley Date: Mon, 10 Mar 2008 13:35:04 +0000 Subject: [PATCH] Merged V2.2 to HEAD 8105: Fix for AR-1828 - multiple users being created from web siteregistration 8107: Merged V2.1 to v2.2 8106: Fixed fallout from MetadataExtractors setting properties to thecorrect data type 8109: Fix for AR-2016 8119: AR-1778: putContent method in the ContentUtils class fail to upload*.java, *.txt, *.xml 8120: AR-1895: fix to web service SDK sample 8125: Test added to prevent regression of AR-1707 8126: Enhanced exception message when non-marking InputStream is used. 8131: Merged V2.1 to V2.2 8129: Merged V1.4 to V2.1: 8128: Fix AR-2041: NPE checking voids during index tracking 8140: AR-1762 - correct generation of download servlet URL git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8477 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../authentication-services-context.xml | 5 +- .../repo/domain/hibernate/Transaction.hbm.xml | 11 ++++ .../HibernateNodeDaoServiceImpl.java | 17 +++++- .../node/index/IndexTransactionTracker.java | 12 +++++ .../RepositoryAuthenticationDao.java | 53 +++++++++++++++++-- 5 files changed, 92 insertions(+), 6 deletions(-) diff --git a/config/alfresco/authentication-services-context.xml b/config/alfresco/authentication-services-context.xml index b9fc315b62..18953cd5f0 100644 --- a/config/alfresco/authentication-services-context.xml +++ b/config/alfresco/authentication-services-context.xml @@ -89,7 +89,10 @@ - + + + + ${user.name.caseSensitive} diff --git a/source/java/org/alfresco/repo/domain/hibernate/Transaction.hbm.xml b/source/java/org/alfresco/repo/domain/hibernate/Transaction.hbm.xml index 9cd5c2a291..2786c018d5 100644 --- a/source/java/org/alfresco/repo/domain/hibernate/Transaction.hbm.xml +++ b/source/java/org/alfresco/repo/domain/hibernate/Transaction.hbm.xml @@ -65,6 +65,17 @@ server.ipAddress = :ipAddress + + select + txn + from + org.alfresco.repo.domain.hibernate.TransactionImpl as txn + where + txn.id = :txnId + order by + txn.commitTimeMs + + () + { + public Object execute() + throws Throwable + { + // Delete the extra user node references + RepositoryAuthenticationDao.this.nodeService.deleteNode(nodeRef); + + return null; + } + + }, false, true); + } + catch (InvalidNodeRefException exception) + { + // Ignore this exception as the node has already been deleted + } } } } @@ -205,7 +233,26 @@ public class RepositoryAuthenticationDao implements MutableAuthenticationDao } else { - throw new AlfrescoRuntimeException("Found more than one user for "+searchUserName+ " (case insensitive)"); + try + { + this.retryingTransactionHelper.doInTransaction( + new RetryingTransactionHelper.RetryingTransactionCallback() + { + public Object execute() + throws Throwable + { + // Delete the extra user node references + RepositoryAuthenticationDao.this.nodeService.deleteNode(nodeRef); + + return null; + } + + }, false, true); + } + catch (InvalidNodeRefException exception) + { + // Ignore this exception as the node has already been deleted + } } } }