mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
add rollback
This commit is contained in:
parent
4a239887cb
commit
ae13169377
@ -167,6 +167,7 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
|
|||||||
} else {
|
} else {
|
||||||
DeviceGroup immediateParentGroup = groupDAO.getGroup(groups.getParentGroupId(), tenantId);
|
DeviceGroup immediateParentGroup = groupDAO.getGroup(groups.getParentGroupId(), tenantId);
|
||||||
if (immediateParentGroup == null) {
|
if (immediateParentGroup == null) {
|
||||||
|
GroupManagementDAOFactory.rollbackTransaction();
|
||||||
String msg = "Parent group with group ID '" + groups.getParentGroupId() + "' does not exist. Hence creating of group '" + groups.getName() + "' was not success";
|
String msg = "Parent group with group ID '" + groups.getParentGroupId() + "' does not exist. Hence creating of group '" + groups.getName() + "' was not success";
|
||||||
log.error(msg);
|
log.error(msg);
|
||||||
throw new GroupManagementException(msg);
|
throw new GroupManagementException(msg);
|
||||||
@ -182,7 +183,7 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
|
|||||||
} else {
|
} else {
|
||||||
throw new GroupManagementException("Group exist with name " + groups.getName());
|
throw new GroupManagementException("Group exist with name " + groups.getName());
|
||||||
}
|
}
|
||||||
} catch (GroupManagementDAOException | GroupManagementException e) {
|
} catch (GroupManagementDAOException e) {
|
||||||
GroupManagementDAOFactory.rollbackTransaction();
|
GroupManagementDAOFactory.rollbackTransaction();
|
||||||
String msg = e.getMessage();
|
String msg = e.getMessage();
|
||||||
log.error(msg, e);
|
log.error(msg, e);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user