Factor out db reconnect code and handle the exception it throws when a reconnect occurs
Factor out db reconnect code and handle the exception it throws when a reconnect occurs

NeCTAR-RC/reporting-api,NeCTAR-RC/reporting-api,NCI-Cloud/reporting-api,NCI-Cloud/reporting-api