mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
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:
@@ -24,6 +24,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.alfresco.repo.security.sync;
|
package org.alfresco.repo.security.sync;
|
||||||
|
|
||||||
|
import java.sql.BatchUpdateException;
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
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.management.subsystems.ChildApplicationContextManager;
|
||||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||||
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
|
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.security.sync.BatchProcessor.Worker;
|
||||||
import org.alfresco.repo.transaction.AlfrescoTransactionSupport;
|
import org.alfresco.repo.transaction.AlfrescoTransactionSupport;
|
||||||
import org.alfresco.repo.transaction.RetryingTransactionHelper;
|
import org.alfresco.repo.transaction.RetryingTransactionHelper;
|
||||||
@@ -817,8 +819,17 @@ public class ChainingUserRegistrySynchronizer extends AbstractLifecycleBean impl
|
|||||||
.getShortName(groupName) + "'");
|
.getShortName(groupName) + "'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
ChainingUserRegistrySynchronizer.this.authorityService.addAuthority(parents, child);
|
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);
|
Set<String> parentsToDelete = groupAssocsToDelete.get(child);
|
||||||
if (parentsToDelete != null && !parentsToDelete.isEmpty())
|
if (parentsToDelete != null && !parentsToDelete.isEmpty())
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user