From 9d3a423dcdfc830f9496283ba6d20e1c83b00fe6 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 14 Oct 2009 20:38:03 +0000 Subject: [PATCH] Fix [2879030] - Import don't show error https://sourceforge.net/tracker/index.php?func=detail&aid=2879030&group_id=176962&atid=879332 --- base/src/org/adempiere/process/ImportPriceList.java | 4 ++-- base/src/org/adempiere/process/UpdateRoleMenu.java | 2 +- base/src/org/adempiere/process/UpdateSequenceNo.java | 2 +- base/src/org/compiere/process/AllocationAuto.java | 4 ++-- base/src/org/compiere/process/BPartnerValidate.java | 6 ++++-- base/src/org/compiere/process/CostUpdate.java | 2 +- base/src/org/compiere/process/ImportAccount.java | 6 +++--- base/src/org/compiere/process/ImportBPartner.java | 4 ++-- base/src/org/compiere/process/ImportBankStatement.java | 2 +- base/src/org/compiere/process/ImportConversionRate.java | 2 +- base/src/org/compiere/process/ImportGLJournal.java | 2 +- base/src/org/compiere/process/ImportInOutConfirm.java | 2 +- base/src/org/compiere/process/ImportInventory.java | 2 +- base/src/org/compiere/process/ImportInvoice.java | 4 ++-- base/src/org/compiere/process/ImportOrder.java | 4 ++-- base/src/org/compiere/process/ImportPayment.java | 2 +- base/src/org/compiere/process/ImportProduct.java | 4 ++-- base/src/org/compiere/process/ImportReportLine.java | 4 ++-- base/src/org/compiere/process/SvrProcess.java | 1 + 19 files changed, 31 insertions(+), 28 deletions(-) diff --git a/base/src/org/adempiere/process/ImportPriceList.java b/base/src/org/adempiere/process/ImportPriceList.java index 88f1508fb7..e18120112d 100755 --- a/base/src/org/adempiere/process/ImportPriceList.java +++ b/base/src/org/adempiere/process/ImportPriceList.java @@ -251,7 +251,7 @@ public class ImportPriceList extends SvrProcess if (no != 0) log.warning("No Mandatory BreakValue=" + no); - commit(); + commitEx(); // ------------------------------------------------------------------- int noInsertpp = 0; @@ -431,7 +431,7 @@ public class ImportPriceList extends SvrProcess pstmt_setImported.setInt(2, I_PriceList_ID); no = pstmt_setImported.executeUpdate(); // - commit(); + commitEx(); } // for all I_PriceList // } diff --git a/base/src/org/adempiere/process/UpdateRoleMenu.java b/base/src/org/adempiere/process/UpdateRoleMenu.java index 3ad79dab0b..1a84514874 100644 --- a/base/src/org/adempiere/process/UpdateRoleMenu.java +++ b/base/src/org/adempiere/process/UpdateRoleMenu.java @@ -92,7 +92,7 @@ public class UpdateRoleMenu extends SvrProcess boolean active = "Y".equals(rs.getString(2)); addUpdateRole(getCtx(), p_role_id, menuId, active, get_TrxName()); } - commit(); + commitEx(); } catch (Exception ex) { diff --git a/base/src/org/adempiere/process/UpdateSequenceNo.java b/base/src/org/adempiere/process/UpdateSequenceNo.java index 44b971eec7..4d927e2017 100644 --- a/base/src/org/adempiere/process/UpdateSequenceNo.java +++ b/base/src/org/adempiere/process/UpdateSequenceNo.java @@ -62,7 +62,7 @@ public class UpdateSequenceNo extends SvrProcess { get_TrxName()); insertStmt.setString(1, year); insertStmt.executeUpdate(); - commit(); + commitEx(); } catch (Exception ex) { rollback(); diff --git a/base/src/org/compiere/process/AllocationAuto.java b/base/src/org/compiere/process/AllocationAuto.java index f31a5eb009..cf8743b4fc 100644 --- a/base/src/org/compiere/process/AllocationAuto.java +++ b/base/src/org/compiere/process/AllocationAuto.java @@ -123,7 +123,7 @@ public class AllocationAuto extends SvrProcess { countBP++; countAlloc += count; - commit(); + commitEx(); } } } @@ -155,7 +155,7 @@ public class AllocationAuto extends SvrProcess { countBP++; countAlloc += count; - commit(); + commitEx(); } } } diff --git a/base/src/org/compiere/process/BPartnerValidate.java b/base/src/org/compiere/process/BPartnerValidate.java index 459851835e..0d6c754ac6 100644 --- a/base/src/org/compiere/process/BPartnerValidate.java +++ b/base/src/org/compiere/process/BPartnerValidate.java @@ -17,6 +17,7 @@ package org.compiere.process; import java.math.BigDecimal; +import java.sql.SQLException; import java.util.Iterator; import java.util.logging.Level; @@ -100,8 +101,9 @@ public class BPartnerValidate extends SvrProcess /** * Check BP * @param bp bp + * @throws SQLException */ - private void checkBP (MBPartner bp) + private void checkBP (MBPartner bp) throws SQLException { addLog(0, null, null, bp.getName() + ":"); // See also VMerge.postMerge @@ -117,7 +119,7 @@ public class BPartnerValidate extends SvrProcess addLog(0, null, bp.getTotalOpenBalance(), Msg.getElement(getCtx(), "TotalOpenBalance")); addLog(0, null, bp.getActualLifeTimeValue(), Msg.getElement(getCtx(), "ActualLifeTimeValue")); // - commit(); + commitEx(); } // checkBP diff --git a/base/src/org/compiere/process/CostUpdate.java b/base/src/org/compiere/process/CostUpdate.java index 28f6b01542..1185d937e2 100644 --- a/base/src/org/compiere/process/CostUpdate.java +++ b/base/src/org/compiere/process/CostUpdate.java @@ -135,7 +135,7 @@ public class CostUpdate extends SvrProcess m_ass = MAcctSchema.getClientAcctSchema(getCtx(), client.getAD_Client_ID()); for (int i = 0; i < m_ass.length; i++) createNew(m_ass[i]); - commit(); + commitEx(); // Update Cost int counter = update(); diff --git a/base/src/org/compiere/process/ImportAccount.java b/base/src/org/compiere/process/ImportAccount.java index 997ca001f4..31b209f769 100644 --- a/base/src/org/compiere/process/ImportAccount.java +++ b/base/src/org/compiere/process/ImportAccount.java @@ -252,7 +252,7 @@ public class ImportAccount extends SvrProcess no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Found ElementValue=" + no); - commit(); + commitEx(); // ------------------------------------------------------------------- int noInsert = 0; @@ -332,7 +332,7 @@ public class ImportAccount extends SvrProcess addLog (0, null, new BigDecimal (noInsert), "@C_ElementValue_ID@: @Inserted@"); addLog (0, null, new BigDecimal (noUpdate), "@C_ElementValue_ID@: @Updated@"); - commit(); + commitEx(); // ***** Set Parent sql = new StringBuffer ("UPDATE I_ElementValue i " @@ -399,7 +399,7 @@ public class ImportAccount extends SvrProcess } addLog (0, null, new BigDecimal (noParentUpdate), "@ParentElementValue_ID@: @Updated@"); - commit(); + commitEx(); // Reset Processing Flag sql = new StringBuffer ("UPDATE I_ElementValue " diff --git a/base/src/org/compiere/process/ImportBPartner.java b/base/src/org/compiere/process/ImportBPartner.java index 93fbb138c8..de554e4cca 100644 --- a/base/src/org/compiere/process/ImportBPartner.java +++ b/base/src/org/compiere/process/ImportBPartner.java @@ -276,7 +276,7 @@ implements ImportProcess ModelValidationEngine.get().fireImportValidate(this, null, null, ImportValidator.TIMING_AFTER_VALIDATE); - commit(); + commitEx(); if (p_IsValidateOnly) { return "Validated"; @@ -573,7 +573,7 @@ implements ImportProcess impBP.setProcessed(true); impBP.setProcessing(false); impBP.saveEx(); - commit(); + commitEx(); } // for all I_Product DB.close(rs, pstmt); } diff --git a/base/src/org/compiere/process/ImportBankStatement.java b/base/src/org/compiere/process/ImportBankStatement.java index 52804d025e..8c51cf5fad 100644 --- a/base/src/org/compiere/process/ImportBankStatement.java +++ b/base/src/org/compiere/process/ImportBankStatement.java @@ -357,7 +357,7 @@ public class ImportBankStatement extends SvrProcess if (no != 0) log.info("Duplicates=" + no); - commit(); + commitEx(); //Import Bank Statement sql = new StringBuffer("SELECT * FROM I_BankStatement" diff --git a/base/src/org/compiere/process/ImportConversionRate.java b/base/src/org/compiere/process/ImportConversionRate.java index 2244a71755..2b88c404dd 100644 --- a/base/src/org/compiere/process/ImportConversionRate.java +++ b/base/src/org/compiere/process/ImportConversionRate.java @@ -227,7 +227,7 @@ public class ImportConversionRate extends SvrProcess // if (no != 0) // log.warn ("Inconsistent Rates =" + no); - commit(); + commitEx(); /*********************************************************************/ int noInsert = 0; diff --git a/base/src/org/compiere/process/ImportGLJournal.java b/base/src/org/compiere/process/ImportGLJournal.java index d85285a6e1..6716874905 100644 --- a/base/src/org/compiere/process/ImportGLJournal.java +++ b/base/src/org/compiere/process/ImportGLJournal.java @@ -574,7 +574,7 @@ public class ImportGLJournal extends SvrProcess pstmt = null; // globalqss (moved the commit here to save the error messages) - commit(); + commitEx(); // Count Errors int errors = DB.getSQLValue(get_TrxName(), diff --git a/base/src/org/compiere/process/ImportInOutConfirm.java b/base/src/org/compiere/process/ImportInOutConfirm.java index 8f0a7e7e6f..fc503330a2 100644 --- a/base/src/org/compiere/process/ImportInOutConfirm.java +++ b/base/src/org/compiere/process/ImportInOutConfirm.java @@ -133,7 +133,7 @@ public class ImportInOutConfirm extends SvrProcess if (no != 0) log.warning ("Invalid Qty=" + no); - commit(); + commitEx(); /*********************************************************************/ diff --git a/base/src/org/compiere/process/ImportInventory.java b/base/src/org/compiere/process/ImportInventory.java index a1256a2863..40f9bf831b 100644 --- a/base/src/org/compiere/process/ImportInventory.java +++ b/base/src/org/compiere/process/ImportInventory.java @@ -210,7 +210,7 @@ public class ImportInventory extends SvrProcess if (no != 0) log.warning ("No QtyCount=" + no); - commit(); + commitEx(); /*********************************************************************/ diff --git a/base/src/org/compiere/process/ImportInvoice.java b/base/src/org/compiere/process/ImportInvoice.java index bc9fdac745..39d3b8d5cf 100644 --- a/base/src/org/compiere/process/ImportInvoice.java +++ b/base/src/org/compiere/process/ImportInvoice.java @@ -476,7 +476,7 @@ public class ImportInvoice extends SvrProcess if (no != 0) log.warning ("Invalid Tax=" + no); - commit(); + commitEx(); // -- New BPartner --------------------------------------------------- @@ -609,7 +609,7 @@ public class ImportInvoice extends SvrProcess if (no != 0) log.warning ("No BPartner=" + no); - commit(); + commitEx(); // -- New Invoices ----------------------------------------------------- diff --git a/base/src/org/compiere/process/ImportOrder.java b/base/src/org/compiere/process/ImportOrder.java index f3b8c8de60..61ccff0628 100644 --- a/base/src/org/compiere/process/ImportOrder.java +++ b/base/src/org/compiere/process/ImportOrder.java @@ -475,7 +475,7 @@ public class ImportOrder extends SvrProcess if (no != 0) log.warning ("Invalid Tax=" + no); - commit(); + commitEx(); // -- New BPartner --------------------------------------------------- @@ -609,7 +609,7 @@ public class ImportOrder extends SvrProcess if (no != 0) log.warning ("No BPartner=" + no); - commit(); + commitEx(); // -- New Orders ----------------------------------------------------- diff --git a/base/src/org/compiere/process/ImportPayment.java b/base/src/org/compiere/process/ImportPayment.java index 3b2bc3eefc..c4aedd2608 100644 --- a/base/src/org/compiere/process/ImportPayment.java +++ b/base/src/org/compiere/process/ImportPayment.java @@ -404,7 +404,7 @@ public class ImportPayment extends SvrProcess if (no != 0) log.warning ("No DocType=" + no); - commit(); + commitEx(); //Import Bank Statement sql = new StringBuffer("SELECT * FROM I_Payment" diff --git a/base/src/org/compiere/process/ImportProduct.java b/base/src/org/compiere/process/ImportProduct.java index 933a28d945..f86c336779 100644 --- a/base/src/org/compiere/process/ImportProduct.java +++ b/base/src/org/compiere/process/ImportProduct.java @@ -378,7 +378,7 @@ public class ImportProduct extends SvrProcess } log.fine("C_TaxCategory_ID=" + C_TaxCategory_ID); - commit(); + commitEx(); // ------------------------------------------------------------------- int noInsert = 0; @@ -628,7 +628,7 @@ public class ImportProduct extends SvrProcess pstmt_setImported.setInt(2, I_Product_ID); no = pstmt_setImported.executeUpdate(); // - commit(); + commitEx(); } // for all I_Product rs.close(); pstmt.close(); diff --git a/base/src/org/compiere/process/ImportReportLine.java b/base/src/org/compiere/process/ImportReportLine.java index e76c0c478f..ba77af16e7 100644 --- a/base/src/org/compiere/process/ImportReportLine.java +++ b/base/src/org/compiere/process/ImportReportLine.java @@ -238,7 +238,7 @@ public class ImportReportLine extends SvrProcess no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set PA_ReportLine_ID=" + no); - commit(); + commitEx(); // ------------------------------------------------------------------- int noInsertLine = 0; @@ -463,7 +463,7 @@ public class ImportReportLine extends SvrProcess log.finest("Delete ReportSource with Null Account= " + no + ", I_ReportLine_ID=" + I_ReportLine_ID + ", PA_ReportSource_ID=" + PA_ReportSource_ID); // End afalcone 22/02/2007 - F.R. [ 1642250 ] Import ReportLine / Very Slow Reports - commit(); + commitEx(); } rs.close(); pstmt.close(); diff --git a/base/src/org/compiere/process/SvrProcess.java b/base/src/org/compiere/process/SvrProcess.java index d875bae09c..e4a418fd82 100644 --- a/base/src/org/compiere/process/SvrProcess.java +++ b/base/src/org/compiere/process/SvrProcess.java @@ -215,6 +215,7 @@ public abstract class SvrProcess implements ProcessCall /** * Commit + * @deprecated suggested to use commitEx instead */ protected void commit() {