mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-8078: [Automation] Deletion of Affinity Groups - CloudRuntimeException: No Event Pubish can be wrapped within DB Transaction!
Changes: - The event of deleteing an affinity group is published on the MessageBus so that IAM Service can listen and process the event, However the publish operation should not be handled within a DB transaction, since it may take longer and hold the DB transaction for long unnecessarily - Publish any events to MessageBus outside of the transaction Conflicts: server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java
This commit is contained in:
parent
a7861aa5fa
commit
01ae7120ac
@ -298,13 +298,14 @@ public class AffinityGroupServiceImpl extends ManagerBase implements AffinityGro
|
||||
if (groupDomain != null) {
|
||||
_affinityGroupDomainMapDao.remove(groupDomain.getId());
|
||||
}
|
||||
// remove its related ACL permission
|
||||
Pair<Class<?>, Long> params = new Pair<Class<?>, Long>(AffinityGroup.class, affinityGroupIdFinal);
|
||||
_messageBus.publish(_name, EntityManager.MESSAGE_REMOVE_ENTITY_EVENT, PublishScope.LOCAL, params);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// remove its related ACL permission
|
||||
Pair<Class<?>, Long> params = new Pair<Class<?>, Long>(AffinityGroup.class, affinityGroupIdFinal);
|
||||
_messageBus.publish(_name, EntityManager.MESSAGE_REMOVE_ENTITY_EVENT, PublishScope.LOCAL, params);
|
||||
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("Deleted affinity group id=" + affinityGroupId);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user