Author: jacopoc
Date: Wed Nov 26 13:19:06 2014
New Revision: 1641805
URL: http://svn.apache.org/r1641805
Log:
Applied fix from trunk for revision: 1641804
===
Fixed issue happening during ./ant create-tenant target on some databases (e.g.
MySQL) where milliseconds are not stored: the order in which the Component
records were selected could be different from the order they were inserted,
causing some data loading issues.
Also fixed some commented out code.
Thanks to Rohit Kaushal for the initial version of the patch and to Arun
Patidar for the review and support.
Modified:
ofbiz/branches/release13.07/ (props changed)
ofbiz/branches/release13.07/framework/entityext/src/org/ofbiz/entityext/data/EntityDataLoadContainer.java
Propchange: ofbiz/branches/release13.07/
------------------------------------------------------------------------------
Merged /ofbiz/trunk:r1641804
Modified:
ofbiz/branches/release13.07/framework/entityext/src/org/ofbiz/entityext/data/EntityDataLoadContainer.java
URL:
http://svn.apache.org/viewvc/ofbiz/branches/release13.07/framework/entityext/src/org/ofbiz/entityext/data/EntityDataLoadContainer.java?rev=1641805&r1=1641804&r2=1641805&view=diff
==============================================================================
---
ofbiz/branches/release13.07/framework/entityext/src/org/ofbiz/entityext/data/EntityDataLoadContainer.java
(original)
+++
ofbiz/branches/release13.07/framework/entityext/src/org/ofbiz/entityext/data/EntityDataLoadContainer.java
Wed Nov 26 13:19:06 2014
@@ -318,33 +318,24 @@ public class EntityDataLoadContainer imp
List<String> loadComponents = FastList.newInstance();
if (UtilValidate.isNotEmpty(delegator.getDelegatorTenantId()) &&
"Y".equals(UtilProperties.getPropertyValue("general.properties",
"multitenant"))) {
try {
- List<EntityExpr> exprs = FastList.newInstance();
- exprs.add(EntityCondition.makeCondition("rootLocation",
EntityOperator.NOT_LIKE, "%hot-deploy%"));
- EntityCondition cond = EntityCondition.makeCondition(exprs);
- List<GenericValue> components =
baseDelegator.findList("Component", cond , null,
UtilMisc.toList("lastUpdatedStamp"), null, false);
- Debug.logInfo("===== Begin load specify components", module);
if (UtilValidate.isEmpty(this.component)) {
- for (GenericValue component : components) {
-
loadComponents.add(component.getString("componentName"));
- //Debug.logInfo("- loaded default component : " +
component.getString("componentName"), module);
+ for (ComponentConfig config : allComponents) {
+ loadComponents.add(config.getComponentName());
}
- Debug.logInfo("- Loaded components by default : " +
components.size() + " components", module);
List<GenericValue> tenantComponents =
baseDelegator.findByAnd("TenantComponent", UtilMisc.toMap("tenantId",
delegator.getDelegatorTenantId()), UtilMisc.toList("sequenceNum"), false);
for (GenericValue tenantComponent : tenantComponents) {
loadComponents.add(tenantComponent.getString("componentName"));
- //Debug.logInfo("- loaded component by tenantId : " +
tenantComponent.getString("tenantId") +", component : " +
tenantComponent.getString("componentName"), module);
}
- Debug.logInfo("- Loaded components by tenantId : " +
delegator.getDelegatorTenantId() + ", " + tenantComponents.size() + "
components", module);
+ Debug.logInfo("Loaded components by tenantId : " +
delegator.getDelegatorTenantId() + ", " + tenantComponents.size() + "
components", module);
} else {
List<GenericValue> tenantComponents =
baseDelegator.findByAnd("TenantComponent", UtilMisc.toMap("tenantId",
delegator.getDelegatorTenantId(), "componentName", this.component),
UtilMisc.toList("sequenceNum"), false);
for (GenericValue tenantComponent : tenantComponents) {
loadComponents.add(tenantComponent.getString("componentName"));
- //Debug.logInfo("- loaded component by tenantId : " +
tenantComponent.getString("tenantId") +", component : " +
tenantComponent.getString("componentName"), module);
}
- Debug.logInfo("- Loaded tenantId : " +
delegator.getDelegatorTenantId() + " and component : " + this.component,
module);
+ Debug.logInfo("Loaded tenantId : " +
delegator.getDelegatorTenantId() + " and component : " + this.component,
module);
}
- Debug.logInfo("===== Loaded : " + loadComponents.size() + "
components", module);
+ Debug.logInfo("Loaded : " + loadComponents.size() + "
components", module);
} catch (GenericEntityException e) {
Debug.logError(e.getMessage(), module);
}