TMSS-1117: use transactions. If one task/subtask creation/update fails, then rollback the whole transaction