jeudi 12 novembre 2020

Design Pattern for importing multiple tables | Stops in case of any failure | Continue in case of failure

I have to import data from various tables from another db to my own db tables.

I have used try and catch block and put methods into same and catching the same.

Code goes below:

importCompanyRoleService.importCompanyRole(emTarget, emSource);

            importCompanyService.importCompany(emTarget, emSource);

            importCompanyStatusService.importCompanyStatus(emTarget, emSource);

            importCountryService.importCountry(emTarget, emSource);

            importLocationRoleService.importLocationRole(emTarget, emSource);

            importLocationService.importLocation(emTarget, emSource);

            importLocationServiceService.importLocationService(emTarget, emSource);

            importLocationStatusService.importLocationStatus(emTarget, emSource);

            importLocationSubareaOfficeService.importLocationSubareaOffice(emTarget, emSource);

            importLocationSubareaService.importLocationSubarea(emTarget, emSource);

Which design pattern fits better in above situation?

  • If i want to stop processing in case of failure
  • if i want to continue processing in case of failure?

This is scheduled job.

Aucun commentaire:

Enregistrer un commentaire