Merged V3.2 to HEAD

17476: ETHREEOH-3374: Fixed problem when LDAP sync worker thread reaches a child group out of order from its parent
      - Used fix from ETHREEOH-3295 to force transaction retry


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@17477 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Dave Ward
2009-11-13 18:11:12 +00:00
parent abe965cf15
commit f351590801

View File

@@ -24,6 +24,7 @@
*/
package org.alfresco.repo.security.sync;
import java.sql.BatchUpdateException;
import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Collection;
@@ -47,6 +48,7 @@ import org.alfresco.repo.management.subsystems.ActivateableBean;
import org.alfresco.repo.management.subsystems.ChildApplicationContextManager;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
import org.alfresco.repo.security.authority.UnknownAuthorityException;
import org.alfresco.repo.security.sync.BatchProcessor.Worker;
import org.alfresco.repo.transaction.AlfrescoTransactionSupport;
import org.alfresco.repo.transaction.RetryingTransactionHelper;
@@ -817,8 +819,17 @@ public class ChainingUserRegistrySynchronizer extends AbstractLifecycleBean impl
.getShortName(groupName) + "'");
}
}
try
{
ChainingUserRegistrySynchronizer.this.authorityService.addAuthority(parents, child);
}
catch (UnknownAuthorityException e)
{
// Let's force a transaction retry if a parent doesn't exist. It may be because we are
// waiting for another worker thread to create it
throw new BatchUpdateException().initCause(e);
}
}
Set<String> parentsToDelete = groupAssocsToDelete.get(child);
if (parentsToDelete != null && !parentsToDelete.isEmpty())
{