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:
Rohit Yadav 2018-02-02 11:14:42 +01:00 committed by Rohit Yadav
parent 260b523a4b
commit 4e3f7e17b8
1 changed files with 1 additions and 2 deletions

View File

@ -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;