commit/rollback logic, log error on writing response