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 + } } } }