Fix missing commit by moving transaction commit after metadata update. #532

Merged
navodzoysa merged 1 commits from nipuni/device-mgt-core:11963 into master 1 month ago

@ -151,9 +151,9 @@ public class DeviceStatusManagementServiceImpl implements DeviceStatusManagement
if (metadataDAO.isExist(tenantId, MetadataConstants.IS_DEVICE_STATUS_CHECK_META_KEY)) { if (metadataDAO.isExist(tenantId, MetadataConstants.IS_DEVICE_STATUS_CHECK_META_KEY)) {
// Add default device status check metadata entries // Add default device status check metadata entries
metadataDAO.updateMetadata(tenantId, constructDeviceStatusCheckMetadata(isChecked)); metadataDAO.updateMetadata(tenantId, constructDeviceStatusCheckMetadata(isChecked));
MetadataManagementDAOFactory.commitTransaction();
return true; return true;
} }
MetadataManagementDAOFactory.commitTransaction();
} catch (MetadataManagementDAOException e) { } catch (MetadataManagementDAOException e) {
MetadataManagementDAOFactory.rollbackTransaction(); MetadataManagementDAOFactory.rollbackTransaction();
String msg = "Error occurred while updating device status check metadata entry."; String msg = "Error occurred while updating device status check metadata entry.";

Loading…
Cancel
Save