mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Fix transaction handling
This commit is contained in:
parent
d6845cd40a
commit
253afa517a
@ -3167,7 +3167,7 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
|
|||||||
throws DeviceManagementException {
|
throws DeviceManagementException {
|
||||||
boolean success;
|
boolean success;
|
||||||
try {
|
try {
|
||||||
DeviceManagementDAOFactory.openConnection();
|
DeviceManagementDAOFactory.beginTransaction();
|
||||||
success = deviceDAO.setEnrolmentStatusInBulk(deviceType, status, getTenantId(), deviceList);
|
success = deviceDAO.setEnrolmentStatusInBulk(deviceType, status, getTenantId(), deviceList);
|
||||||
DeviceManagementDAOFactory.commitTransaction();
|
DeviceManagementDAOFactory.commitTransaction();
|
||||||
} catch (DeviceManagementDAOException e) {
|
} catch (DeviceManagementDAOException e) {
|
||||||
@ -3175,7 +3175,7 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
|
|||||||
String msg = "Error occurred in while updating status of devices :" + deviceType + " status : " + status;
|
String msg = "Error occurred in while updating status of devices :" + deviceType + " status : " + status;
|
||||||
log.error(msg, e);
|
log.error(msg, e);
|
||||||
throw new DeviceManagementException(msg, e);
|
throw new DeviceManagementException(msg, e);
|
||||||
} catch (SQLException e) {
|
} catch (TransactionManagementException e) {
|
||||||
String msg = "Error occurred while opening a connection to the data source";
|
String msg = "Error occurred while opening a connection to the data source";
|
||||||
log.error(msg, e);
|
log.error(msg, e);
|
||||||
throw new DeviceManagementException(msg, e);
|
throw new DeviceManagementException(msg, e);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user