Author: arunpatidar
Date: Fri Feb 1 09:00:44 2019 New Revision: 1852680 URL: http://svn.apache.org/viewvc?rev=1852680&view=rev Log: Applied fix from trunk for revision: 1852587 === Fixed: Services of EntitySync Push and Pull functionalities (OFBIZ-10818) Set transaction timeout of 2hrs for the actual data transmission services. Removed unwanted service updateEntitySyncRunning Called the tracking and status update services in new transaction so that record can be maintain after current transaction rollback Modified: ofbiz/ofbiz-framework/branches/release18.12/ (props changed) ofbiz/ofbiz-framework/branches/release18.12/framework/entityext/servicedef/services.xml ofbiz/ofbiz-framework/branches/release18.12/framework/entityext/src/main/java/org/apache/ofbiz/entityext/synchronization/EntitySyncContext.java Propchange: ofbiz/ofbiz-framework/branches/release18.12/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Fri Feb 1 09:00:44 2019 @@ -10,4 +10,4 @@ /ofbiz/branches/json-integration-refactoring:1634077-1635900 /ofbiz/branches/multitenant20100310:921280-927264 /ofbiz/branches/release13.07:1547657 -/ofbiz/ofbiz-framework/trunk:1850015,1850023,1850530,1850647,1850685,1850694,1850711,1850914,1850918,1850921,1850948,1850953,1851006,1851013,1851068,1851074,1851130,1851158,1851200,1851224,1851247,1851254,1851315,1851319,1851350,1851353,1851433,1851500,1851805,1851885,1851998,1852503 +/ofbiz/ofbiz-framework/trunk:1850015,1850023,1850530,1850647,1850685,1850694,1850711,1850914,1850918,1850921,1850948,1850953,1851006,1851013,1851068,1851074,1851130,1851158,1851200,1851224,1851247,1851254,1851315,1851319,1851350,1851353,1851433,1851500,1851805,1851885,1851998,1852503,1852587 Modified: ofbiz/ofbiz-framework/branches/release18.12/framework/entityext/servicedef/services.xml URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/branches/release18.12/framework/entityext/servicedef/services.xml?rev=1852680&r1=1852679&r2=1852680&view=diff ============================================================================== --- ofbiz/ofbiz-framework/branches/release18.12/framework/entityext/servicedef/services.xml (original) +++ ofbiz/ofbiz-framework/branches/release18.12/framework/entityext/servicedef/services.xml Fri Feb 1 09:00:44 2019 @@ -201,27 +201,19 @@ under the License. <auto-attributes include="pk" mode="IN" optional="false"/> </service> - <service name="updateEntitySyncRunning" default-entity-name="EntitySync" engine="entity-auto" invoke="update" auth="true"> - <description>Update EntitySync</description> - <permission-service service-name="entitySyncPermissionCheck" main-action="UPDATE"/> - <auto-attributes include="pk" mode="IN" optional="false"/> - <auto-attributes include="nonpk" mode="IN" optional="true"/> - </service> - - <service name="createEntitySyncHistory" default-entity-name="EntitySyncHistory" engine="entity-auto" invoke="create" auth="true"> + <service name="createEntitySyncHistory" default-entity-name="EntitySyncHistory" engine="entity-auto" invoke="create" auth="true" require-new-transaction="true"> <description>Create EntitySyncHistory</description> <permission-service service-name="entitySyncPermissionCheck" main-action="CREATE"/> <auto-attributes include="pk" mode="INOUT" optional="false"/> <auto-attributes include="nonpk" mode="IN" optional="true"/> - <override name="startDate" mode="OUT"/> </service> - <service name="updateEntitySyncHistory" default-entity-name="EntitySyncHistory" engine="entity-auto" invoke="update" auth="true"> + <service name="updateEntitySyncHistory" default-entity-name="EntitySyncHistory" engine="entity-auto" invoke="update" auth="true" require-new-transaction="true"> <description>Update EntitySyncHistory</description> <permission-service service-name="entitySyncPermissionCheck" main-action="UPDATE"/> <auto-attributes include="pk" mode="IN" optional="false"/> <auto-attributes include="nonpk" mode="IN" optional="true"/> </service> - <service name="deleteEntitySyncHistory" default-entity-name="EntitySyncHistory" engine="entity-auto" invoke="delete" auth="true"> + <service name="deleteEntitySyncHistory" default-entity-name="EntitySyncHistory" engine="entity-auto" invoke="delete" auth="true" require-new-transaction="true"> <description>Delete EntitySyncHistory</description> <permission-service service-name="entitySyncPermissionCheck" main-action="DELETE"/> <auto-attributes include="pk" mode="IN" optional="false"/> @@ -307,12 +299,12 @@ under the License. </service> <!-- Services to call store (Push) remotely --> - <service name="remoteStoreEntitySyncDataHttp" engine="http" auth="true" use-transaction="false" + <service name="remoteStoreEntitySyncDataHttp" engine="http" auth="true" use-transaction="false" transaction-timeout="7200" location="entity-sync-http" invoke="storeEntitySyncData"> <description>Remotely Store Entity Sync Date</description> <implements service="storeEntitySyncData"/> </service> - <service name="remoteStoreEntitySyncDataRmi" engine="rmi" auth="true" use-transaction="false" + <service name="remoteStoreEntitySyncDataRmi" engine="rmi" auth="true" use-transaction="false" transaction-timeout="7200" location="entity-sync-rmi" invoke="storeEntitySyncData"> <description>Remotely Store Entity Sync Data</description> <implements service="storeEntitySyncData"/> Modified: ofbiz/ofbiz-framework/branches/release18.12/framework/entityext/src/main/java/org/apache/ofbiz/entityext/synchronization/EntitySyncContext.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/branches/release18.12/framework/entityext/src/main/java/org/apache/ofbiz/entityext/synchronization/EntitySyncContext.java?rev=1852680&r1=1852679&r2=1852680&view=diff ============================================================================== --- ofbiz/ofbiz-framework/branches/release18.12/framework/entityext/src/main/java/org/apache/ofbiz/entityext/synchronization/EntitySyncContext.java (original) +++ ofbiz/ofbiz-framework/branches/release18.12/framework/entityext/src/main/java/org/apache/ofbiz/entityext/synchronization/EntitySyncContext.java Fri Feb 1 09:00:44 2019 @@ -309,7 +309,7 @@ public class EntitySyncContext { } this.startDate = (Timestamp) initialHistoryRes.get("startDate"); - Map<String, Object> result = dispatcher.runSync("updateEntitySync", UtilMisc.toMap("entitySyncId", entitySyncId, "lastHistoryStartDate", this.startDate, "userLogin", userLogin)); + Map<String, Object> result = dispatcher.runSync("updateEntitySync", UtilMisc.toMap("entitySyncId", entitySyncId, "lastHistoryStartDate", this.startDate, "userLogin", userLogin),60,true); if (ServiceUtil.isError(result)) { throw new SyncDataErrorException(errorMsg, null, null, result, null); } @@ -772,7 +772,7 @@ public class EntitySyncContext { this.totalRowsToRemove += this.toRemoveAlreadyDeleted + this.toRemoveDeleted; // store latest result on EntitySync, ie update lastSuccessfulSynchTime, should run in own tx - Map<String, Object> updateEsRunResult = dispatcher.runSync("updateEntitySyncRunning", UtilMisc.toMap("entitySyncId", entitySyncId, "lastSuccessfulSynchTime", this.currentRunEndTime, "userLogin", userLogin)); + Map<String, Object> updateEsRunResult = dispatcher.runSync("updateEntitySync", UtilMisc.toMap("entitySyncId", entitySyncId, "lastSuccessfulSynchTime", this.currentRunEndTime, "userLogin", userLogin),60,true); GenericValue entitySyncHistory = EntityQuery.use(delegator).from("EntitySyncHistory").where("startDate",startDate, "entitySyncId", entitySyncId).queryOne(); if(entitySyncHistory != null) { @@ -832,7 +832,7 @@ public class EntitySyncContext { // the lastSuccessfulSynchTime on EntitySync will already be set, so just set status as completed String esErrMsg = "Could not mark Entity Sync as complete, but all synchronization was successful"; try { - Map<String, Object> completeEntitySyncRes = dispatcher.runSync("updateEntitySyncRunning", UtilMisc.toMap("entitySyncId", entitySyncId, "runStatusId", newStatusId, "userLogin", userLogin)); + Map<String, Object> completeEntitySyncRes = dispatcher.runSync("updateEntitySync", UtilMisc.toMap("entitySyncId", entitySyncId, "runStatusId", newStatusId, "userLogin", userLogin), 60,true); if (ServiceUtil.isError(completeEntitySyncRes)) { // what to do here? try again? throw new SyncDataErrorException(esErrMsg, null, null, completeEntitySyncRes, null); @@ -925,7 +925,7 @@ public class EntitySyncContext { public void saveSyncErrorInfo(String runStatusId, List<Object> errorMessages) { // set error statuses on the EntitySync and EntitySyncHistory entities try { - Map<String, Object> errorEntitySyncRes = dispatcher.runSync("updateEntitySyncRunning", UtilMisc.toMap("entitySyncId", entitySyncId, "runStatusId", runStatusId, "userLogin", userLogin)); + Map<String, Object> errorEntitySyncRes = dispatcher.runSync("updateEntitySync", UtilMisc.toMap("entitySyncId", entitySyncId, "runStatusId", runStatusId, "userLogin", userLogin), 60,true); if (ServiceUtil.isError(errorEntitySyncRes)) { errorMessages.add("Could not save error run status [" + runStatusId + "] on EntitySync with ID [" + entitySyncId + "]: " + errorEntitySyncRes.get(ModelService.ERROR_MESSAGE)); } @@ -959,7 +959,7 @@ public class EntitySyncContext { try { // not running, get started NOW // set running status on entity sync, run in its own tx - Map<String, Object> startEntitySyncRes = dispatcher.runSync("updateEntitySyncRunning", UtilMisc.toMap("entitySyncId", entitySyncId, "runStatusId", "ESR_RUNNING", "userLogin", userLogin)); + Map<String, Object> startEntitySyncRes = dispatcher.runSync("updateEntitySync", UtilMisc.toMap("entitySyncId", entitySyncId, "runStatusId", "ESR_RUNNING", "userLogin", userLogin), 60,true); if (ModelService.RESPOND_ERROR.equals(startEntitySyncRes.get(ModelService.RESPONSE_MESSAGE))) { throw new SyncDataErrorException(markErrorMsg, null, null, startEntitySyncRes, null); } @@ -1039,7 +1039,7 @@ public class EntitySyncContext { try { // not running, get started NOW // set running status on entity sync, run in its own tx - Map<String, Object> startEntitySyncRes = dispatcher.runSync("updateEntitySyncRunning", UtilMisc.toMap("entitySyncId", entitySyncId, "runStatusId", "ESR_RUNNING", "userLogin", userLogin)); + Map<String, Object> startEntitySyncRes = dispatcher.runSync("updateEntitySync", UtilMisc.toMap("entitySyncId", entitySyncId, "runStatusId", "ESR_RUNNING", "userLogin", userLogin),60,true); if (ModelService.RESPOND_ERROR.equals(startEntitySyncRes.get(ModelService.RESPONSE_MESSAGE))) { throw new SyncDataErrorException(markErrorMsg, null, null, startEntitySyncRes, null); } @@ -1111,7 +1111,7 @@ public class EntitySyncContext { try { // not running, get started NOW // set running status on entity sync, run in its own tx - Map<String, Object> startEntitySyncRes = dispatcher.runSync("updateEntitySyncRunning", UtilMisc.toMap("entitySyncId", entitySyncId, "runStatusId", "ESR_RUNNING", "preOfflineSynchTime", this.lastSuccessfulSynchTime, "userLogin", userLogin)); + Map<String, Object> startEntitySyncRes = dispatcher.runSync("updateEntitySync", UtilMisc.toMap("entitySyncId", entitySyncId, "runStatusId", "ESR_RUNNING", "preOfflineSynchTime", this.lastSuccessfulSynchTime, "userLogin", userLogin),60,true); if (ModelService.RESPOND_ERROR.equals(startEntitySyncRes.get(ModelService.RESPONSE_MESSAGE))) { throw new SyncDataErrorException(markErrorMsg, null, null, startEntitySyncRes, null); } |
Free forum by Nabble | Edit this page |