mirror of https://github.com/apache/cloudstack.git
APPLE-525: Set role name to null on removal (CW-1647)
On removal of a role, set the name to null. This fixes issue of mysql integrity exception when roles are created/deleted aggresively. Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
260b523a4b
commit
4e3f7e17b8
|
|
@ -50,7 +50,6 @@ import javax.inject.Inject;
|
|||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Local(value = {RoleService.class})
|
||||
|
|
@ -175,7 +174,7 @@ public class RoleManagerImpl extends ManagerBase implements RoleService, Configu
|
|||
}
|
||||
if (roleDao.remove(role.getId())) {
|
||||
RoleVO roleVO = roleDao.findByIdIncludingRemoved(role.getId());
|
||||
roleVO.setName(role.getName() + "-deleted-" + new Date());
|
||||
roleVO.setName(null);
|
||||
return roleDao.update(role.getId(), roleVO);
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Reference in New Issue