Issue 23385: , Backed out: 6792989a9124
authorStefan Hühner <stefan.huehner@openbravo.com>
Fri, 31 May 2013 18:19:45 +0200
changeset 20506 e84ef22ffd85
parent 20505 ec1c4db1c441
child 20507 31f9b82dde77
Issue 23385: , Backed out: 6792989a9124
As is breaks OrgSetup when using the optional 'Location' field.
src/org/openbravo/erpCommon/ad_forms/InitialOrgSetup.java
src/org/openbravo/erpCommon/businessUtility/InitialOrgSetup.java
--- a/src/org/openbravo/erpCommon/ad_forms/InitialOrgSetup.java	Fri May 31 12:44:01 2013 +0200
+++ b/src/org/openbravo/erpCommon/ad_forms/InitialOrgSetup.java	Fri May 31 18:19:45 2013 +0200
@@ -30,7 +30,6 @@
 import org.openbravo.base.secureApp.OrgTree;
 import org.openbravo.base.secureApp.VariablesSecureApp;
 import org.openbravo.dal.core.OBContext;
-import org.openbravo.dal.service.OBDal;
 import org.openbravo.erpCommon.businessUtility.WindowTabs;
 import org.openbravo.erpCommon.modules.ModuleReferenceDataOrgTree;
 import org.openbravo.erpCommon.utility.LeftTabsBar;
@@ -42,7 +41,6 @@
 
 public class InitialOrgSetup extends HttpSecureAppServlet {
   private static final long serialVersionUID = 1L;
-  private static final String OKTYPE = "Success";
 
   @Override
   public void doPost(HttpServletRequest request, HttpServletResponse response)
@@ -74,9 +72,6 @@
           strParentOrg, strcLocationId, strPassword, strModules, isTrue(strCreateAccounting),
           fileCoAFilePath, strCurrency, bBPartner, bProduct, bProject, bCampaign, bSalesRegion,
           vars.getSessionValue("#SOURCEPATH"));
-      if (!obeResult.getType().equals(OKTYPE)) {
-        OBDal.getInstance().rollbackAndClose();
-      }
       vars.setSessionValue("#USER_ORG", vars.getSessionValue("#USER_ORG") + ", '" + ios.getOrgId()
           + "'");
       vars.setSessionValue("#ORG_CLIENT",
--- a/src/org/openbravo/erpCommon/businessUtility/InitialOrgSetup.java	Fri May 31 12:44:01 2013 +0200
+++ b/src/org/openbravo/erpCommon/businessUtility/InitialOrgSetup.java	Fri May 31 18:19:45 2013 +0200
@@ -160,6 +160,7 @@
     OBContext.getOBContext().getWritableOrganizations();
     try {
       OBDal.getInstance().flush();
+      OBDal.getInstance().commitAndClose();
       org = OBDal.getInstance().get(Organization.class, strOrgId);
       client = org.getClient();
       if (strcLocationId != null && !strcLocationId.equals(""))
@@ -248,7 +249,6 @@
 
     obResult.setType(OKTYPE);
     obResult.setMessage("@" + OKTYPE + "@");
-    OBDal.getInstance().commitAndClose();
 
     return obResult;