svn commit: r1835296 - in /ofbiz/ofbiz-framework/trunk/framework: common/config/general.properties entity/src/main/java/org/apache/ofbiz/entity/GenericDelegator.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1835296 - in /ofbiz/ofbiz-framework/trunk/framework: common/config/general.properties entity/src/main/java/org/apache/ofbiz/entity/GenericDelegator.java

jleroux@apache.org
Author: jleroux
Date: Sat Jul  7 07:46:04 2018
New Revision: 1835296

URL: http://svn.apache.org/viewvc?rev=1835296&view=rev
Log:
Implemented:
(OFBIZ-10008)

No configurations is available to disable usage of EntitySyncRemove.
And it's creating problems when having a large database and frequent delete
operations.

saveEntitySyncRemoveInfo is used to create EntitySyncRemove records in
GenericDelegator.removeValue() and removeByPrimaryKey().

This adds a mechanism to prevent the usage of EntitySyncRemove by adding a
property in general.properties file used to configure in entityengine.xml





Modified:
    ofbiz/ofbiz-framework/trunk/framework/common/config/general.properties
    ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/GenericDelegator.java

Modified: ofbiz/ofbiz-framework/trunk/framework/common/config/general.properties
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/common/config/general.properties?rev=1835296&r1=1835295&r2=1835296&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/common/config/general.properties (original)
+++ ofbiz/ofbiz-framework/trunk/framework/common/config/general.properties Sat Jul  7 07:46:04 2018
@@ -131,6 +131,8 @@ mail.spam.value=YES
 # -- HTTP JSON settings
 http.json.xssi.prefix=//
 
+# -- Save Entity Sync Remove Info. This is used in the context of Entity Sync, doc currently updated, WIP at OFBIZ-10390...  
+saveEntitySyncRemoveInfo=false
 
 # -- Y if you want to display the multi-tenant textbox in the login page and install specify components which related to each tenant
 multitenant=N

Modified: ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/GenericDelegator.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/GenericDelegator.java?rev=1835296&r1=1835295&r2=1835296&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/GenericDelegator.java (original)
+++ ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/GenericDelegator.java Sat Jul  7 07:46:04 2018
@@ -47,6 +47,7 @@ import org.apache.ofbiz.base.util.UtilFo
 import org.apache.ofbiz.base.util.UtilGenerics;
 import org.apache.ofbiz.base.util.UtilMisc;
 import org.apache.ofbiz.base.util.UtilObject;
+import org.apache.ofbiz.base.util.UtilProperties;
 import org.apache.ofbiz.base.util.UtilValidate;
 import org.apache.ofbiz.base.util.UtilXml;
 import org.apache.ofbiz.entity.cache.Cache;
@@ -96,6 +97,8 @@ public class GenericDelegator implements
     protected ModelGroupReader modelGroupReader = null;
     /** This flag is only here for lower level technical testing, it shouldn't be user configurable (or at least I don't think so yet); when true all operations without a transaction will be wrapped in one; seems to be necessary for some (all?) XA aware connection pools, and should improve overall stability and consistency */
     public static final boolean alwaysUseTransaction = true;
+    // TODO should this is be handled by tenant?
+    public static final boolean saveEntitySyncRemoveInfo = UtilProperties.getPropertyAsBoolean("general", "saveEntitySyncRemove", false);
 
     protected String delegatorBaseName = null;
     protected String delegatorFullName = null;
@@ -1053,7 +1056,9 @@ public class GenericDelegator implements
                 }
             }
 
-            this.saveEntitySyncRemoveInfo(value.getPrimaryKey());
+            if (saveEntitySyncRemoveInfo) {
+                this.saveEntitySyncRemoveInfo(value.getPrimaryKey());
+            }
 
             ecaRunner.evalRules(EntityEcaHandler.EV_RETURN, EntityEcaHandler.OP_REMOVE, value, false);
             TransactionUtil.commit(beganTransaction);