IDEMPIERE-2565 - found transaction not rolled back when initial client setup was failing with an exception

This commit is contained in:
Carlos Ruiz 2015-04-08 10:15:57 -05:00
parent da2fd9fffb
commit 267fe358df
2 changed files with 30 additions and 26 deletions

View File

@ -257,7 +257,7 @@ public class InitialClientSetup extends SvrProcess
// Process
MSetup ms = new MSetup(Env.getCtx(), WINDOW_THIS_PROCESS);
try {
if (! ms.createClient(p_ClientName, p_OrgValue, p_OrgName, p_AdminUserName, p_NormalUserName
, p_Phone, p_Phone2, p_Fax, p_EMail, p_TaxID, p_AdminUserEmail, p_NormalUserEmail)) {
ms.rollback();
@ -285,6 +285,10 @@ public class InitialClientSetup extends SvrProcess
// Create Print Documents
PrintUtil.setupPrintForm(ms.getAD_Client_ID());
} catch (Exception e) {
ms.rollback();
throw e;
}
return "@OK@";
}

View File

@ -465,7 +465,7 @@ public class MLocation extends X_C_Location implements Comparator<Object>
if (c == null)
return "CountryNotFound";
boolean local = getC_Country_ID() == MCountry.getDefault(getCtx()).getC_Country_ID();
boolean local = MCountry.getDefault(getCtx()) != null && getC_Country_ID() == MCountry.getDefault(getCtx()).getC_Country_ID();
String inStr = local ? c.getDisplaySequenceLocal() : c.getDisplaySequence();
StringBuilder outStr = new StringBuilder();