@Override protected void process() { for (Invoice invoice : invoices(batch.getInvoiceBatch(), true)) { try { invoiceService.validate(invoiceRepo.find(invoice.getId())); updateInvoice(invoiceRepo.find(invoice.getId())); } catch (AxelorException e) { TraceBackService.trace( new AxelorException( String.format(I18n.get("Facture") + " %s", invoice.getInvoiceId()), e, e.getcategory()), IException.INVOICE_ORIGIN, batch.getId()); incrementAnomaly(); } catch (Exception e) { TraceBackService.trace( new Exception(String.format(I18n.get("Facture") + " %s", invoice.getInvoiceId()), e), IException.INVOICE_ORIGIN, batch.getId()); incrementAnomaly(); } finally { JPA.clear(); } } }