Openbravo Issue Tracking System - Retail Modules
View Issue Details
0037731Retail ModulesStoreServerpublic2018-01-25 16:332018-03-09 22:03
Asantos9 
AugustoMauch 
normalmajoralways
closedfixed 
5
 
 
mtaal
No
0037731: obstsyn_srvr_bp_uni constraint is sometimes violated when synchronizing a business partner from a store to the central server
Under some very specific conditions, there obstsyn_srvr_bp_uni constraint is violated:
- The business partner must already exist in the CS
- It must have a default store other than the one where it is being synchronized
- The batch of the entries being synchronized must contain two or more changes related with that business partner.

When a entry from business partner is synchronized the BPartnerStoreWriterFilterAdapter class adds to the business partner the store from where the business partner was synchronized. This class is not working properly in the conditions mentioned above.
I have not been able to reproduce it manually, it came from BUT where they use RCU to read business partners in the POS.

The environment where it was reproduced had the conditions listed in the issue description:
- The business partner must already exist in the CS
- It must have a default store other than the one where it is being synchronized
- The batch of the entries being synchronized must contain two or more changes related with that business partner.

Looking at the code, it is clear that there is a problem because to check if a business partner belongs to a store the business partner instance in the DAL session is checked, but BPartnerStoreWriterFilterAdapter is adding them directly to the database, so the DAL instance in the session is not aware of the changes.
No tags attached.
related to defect 0037666 closed AugustoMauch Error when creating an order: duplicate key value violates unique constraint "obstsyn_srvr_bp_uni" 
png Screenshot from 2018-03-09 07-26-33.png (85,319) 2018-03-09 07:34
https://issues.openbravo.com/file_download.php?file_id=11625&type=bug
png
Issue History
2018-01-25 16:33Asantos9New Issue
2018-01-25 16:33Asantos9Assigned To => StoreServer
2018-01-25 16:33Asantos9Resolution time => 1517439600
2018-01-25 16:33Asantos9Triggers an Emergency Pack => No
2018-01-25 16:36Asantos9Review Assigned To => AugustoMauch
2018-01-25 16:37Asantos9Review Assigned ToAugustoMauch =>
2018-01-25 16:37Asantos9Assigned ToStoreServer => AugustoMauch
2018-02-21 14:34AugustoMauchRelationship addedrelated to 0037666
2018-02-21 14:43AugustoMauchSummaryAn error is throwing when it is completed a ticket with some customers => obstsyn_srvr_bp_uni constraint is sometimes violated when synchronizing a business partner from a store to the centarl server
2018-02-21 14:43AugustoMauchDescription Updatedbug_revision_view_page.php?rev_id=16753#r16753
2018-02-21 14:43AugustoMauchSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=16755#r16755
2018-02-21 14:47hgbotCheckin
2018-02-21 14:47hgbotNote Added: 0102558
2018-02-21 14:47hgbotStatusnew => resolved
2018-02-21 14:47hgbotResolutionopen => fixed
2018-02-21 14:47hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/f031b93fa22c9c08d639d04af933ce23396160a7 [^]
2018-02-21 14:48AugustoMauchReview Assigned To => mtaal
2018-02-22 14:55mtaalNote Added: 0102600
2018-02-22 14:55mtaalStatusresolved => new
2018-02-22 14:55mtaalResolutionfixed => open
2018-02-27 18:43hgbotCheckin
2018-02-27 18:43hgbotNote Added: 0102859
2018-02-27 18:43hgbotStatusnew => resolved
2018-02-27 18:43hgbotResolutionopen => fixed
2018-02-27 18:43hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/f031b93fa22c9c08d639d04af933ce23396160a7 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/3c18f299263341de4854d07861fca7c20aa2a315 [^]
2018-03-01 17:36AugustoMauchSummaryobstsyn_srvr_bp_uni constraint is sometimes violated when synchronizing a business partner from a store to the centarl server => obstsyn_srvr_bp_uni constraint is sometimes violated when synchronizing a business partner from a store to the central server
2018-03-08 15:10hgbotCheckin
2018-03-08 15:10hgbotNote Added: 0103083
2018-03-08 15:10hgbotCheckin
2018-03-08 15:10hgbotNote Added: 0103084
2018-03-09 07:34mtaalNote Added: 0103112
2018-03-09 07:34mtaalStatusresolved => new
2018-03-09 07:34mtaalResolutionfixed => open
2018-03-09 07:34mtaalFile Added: Screenshot from 2018-03-09 07-26-33.png
2018-03-09 10:24hgbotCheckin
2018-03-09 10:24hgbotNote Added: 0103118
2018-03-09 10:24hgbotStatusnew => resolved
2018-03-09 10:24hgbotResolutionopen => fixed
2018-03-09 10:24hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/3c18f299263341de4854d07861fca7c20aa2a315 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/ce206adbbec085cbffcd6e095daf353fdbed3ddf [^]
2018-03-09 22:03mtaalNote Added: 0103142
2018-03-09 22:03mtaalStatusresolved => closed

Notes
(0102558)
hgbot   
2018-02-21 14:47   
Repository: erp/pmods/org.openbravo.retail.storeserver.synchronization
Changeset: f031b93fa22c9c08d639d04af933ce23396160a7
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Wed Feb 21 14:46:41 2018 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/f031b93fa22c9c08d639d04af933ce23396160a7 [^]

Fixes issue 37731: Prevents breaking obstsyn_srvr_bp_uni unique constraint

The problem was the following:
- BPartnerStoreWriterFilterAdapter intercepts entries of c_bpartner when they are synchronized from a store to the central server and adds that store
to the list of stores accessible by the imported business partner
- It is using the BusinessPartnerSegmentationUtils.businessPartnerIsPartOfStore API to check if the business partner belongs to the store. This API determines
this by checking the state of the business partner in the session (see issue https://issues.openbravo.com/view.php?id=37666 [^]).
- The problem is that the BPartnerStoreWriterFilterAdapter does not use DAL to add the store to the business partner, so if after that it uses the
BusinessPartnerSegmentationUtils.businessPartnerIsPartOfStore API to check if the business partner belongs to the store, it will return false.

This has been fixed by refreshing the business partner before checking the BusinessPartnerSegmentationUtils.businessPartnerIsPartOfStore API. I tried to fix it
by using fully the BusinessPartnerSegmentationUtils API, but got into problems as it is problematic to update/create objects with DAL in a
DatabaseWriterFilterAdapter.

---
M src/org/openbravo/retail/storeserver/synchronization/BPartnerStoreWriterFilterAdapter.java
---
(0102600)
mtaal   
2018-02-22 14:55   
As the refresh happens in a different transaction from the update by the writer adapter it is unclear if the refresh will actually see the update done directly by the writer.

Re-opening the issue to further study this.
(0102859)
hgbot   
2018-02-27 18:43   
Repository: erp/pmods/org.openbravo.retail.storeserver.synchronization
Changeset: 3c18f299263341de4854d07861fca7c20aa2a315
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Feb 27 18:42:09 2018 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/3c18f299263341de4854d07861fca7c20aa2a315 [^]

Fixes issue 37731: Prevents breaking obstsyn_srvr_bp_uni unique constraint

The main problem was that the same logic was duplicated in two places (BPartnerStoreWriterFilterAdapter and BusinessPartnerAndRelatedTablesSynchronizer), one was using DAL
to access the database and another one was using SymmetricDS' connection. The code of BusinessPartnerAndRelatedTablesSynchronizer has been updated to accept a connection
(it will use DAL by default if none is passed), and now it can be reused.

It was not possible to use xsql to define the queries because the generated java class was invoking SessionInfo.saveContextInfoIntoDB(conn), which fails if the ad_context_info
table is not defined for the given connection. That temporary table is not present in the connections from SymmetricDS, so it would fail.

[1] https://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/f031b93fa22c9c08d639d04af933ce23396160a7 [^]

---
M src/org/openbravo/retail/storeserver/synchronization/BPartnerStoreWriterFilterAdapter.java
M src/org/openbravo/retail/storeserver/synchronization/process/BusinessPartnerAndRelatedTablesSynchronizer.java
M src/org/openbravo/retail/storeserver/synchronization/utils/BusinessPartnerSegmentationUtils.java
---
(0103083)
hgbot   
2018-03-08 15:10   
Repository: erp/pmods/org.openbravo.retail.storeserver.synchronization
Changeset: f036213c01c51e8cc1523d5a6aabe41a74674605
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Thu Mar 08 14:51:43 2018 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/f036213c01c51e8cc1523d5a6aabe41a74674605 [^]

Related with issue 37731: Sync a bp from store to central server works properly

When a business partner was created in an offline store server, the BPartnerStoreWriterFilterAdapter in the central server was not
assigning the default store to that business partner properly, because it was mixing up DAL with no-DAL.

---
M src/org/openbravo/retail/storeserver/synchronization/BPartnerStoreWriterFilterAdapter.java
M src/org/openbravo/retail/storeserver/synchronization/utils/BusinessPartnerSegmentationUtils.java
---
(0103084)
hgbot   
2018-03-08 15:10   
Repository: erp/pmods/org.openbravo.retail.storeserver.synchronization
Changeset: 7d39d269edec5effa03ff243ad1a25a259093403
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Thu Mar 08 15:10:14 2018 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/7d39d269edec5effa03ff243ad1a25a259093403 [^]

Related with issue 37731: Ensures info is updated between DAL <-> DB

- Flushes before querying the database, if a BusinessPartner DAL instance is provided
- Refreshes the BusinessPartner instance after updating it in the database

---
M src/org/openbravo/retail/storeserver/synchronization/StoreBusinessPartnerLoaderHook.java
M src/org/openbravo/retail/storeserver/synchronization/utils/BusinessPartnerSegmentationUtils.java
---
(0103112)
mtaal   
2018-03-09 07:34   
I get the exception below when creating a new bp and then enter a ticket for the bp.

This happens when the orderloader saves a payment then the OrderEventHandler is also called as it has been enabled for FIN_PAYMENT also [2].
In the OrderEventHandler the business partner segment utils is called which does flush. I am not sure it is not totally correct to do flush inside of an eventhandler as this might intervene with the save/update flow of the Hibernate eventhandler.

I tested it and this line has to be removed to not let it happen:

Alternatively, I am not sure why we are using the OrderEventHandler also for FIN_PAYMENT.

[1]
org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
    at org.hibernate.jdbc.Expectations$BasicExpectation.checkBatched(Expectations.java:85)
    at org.hibernate.jdbc.Expectations$BasicExpectation.verifyOutcome(Expectations.java:70)
    at org.hibernate.jdbc.BatchingBatcher.checkRowCounts(BatchingBatcher.java:90)
    at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70)
    at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268)
    at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:268)
    at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:185)
    at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
    at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51)
    at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1216)
    at org.openbravo.dal.service.OBDal.flush(OBDal.java:260)
    at org.openbravo.retail.storeserver.synchronization.utils.BusinessPartnerSegmentationUtils.businessPartnerIsPartOfStore(BusinessPartnerSegmentationUtils.java:54)
    at org.openbravo.retail.storeserver.synchronization.eventhandler.OrderEventHandler.addBusinessPartnerToStoresWithAccessToOrganization(OrderEventHandler.java:135)
    at org.openbravo.retail.storeserver.synchronization.eventhandler.OrderEventHandler.doEvent(OrderEventHandler.java:125)
    at org.openbravo.retail.storeserver.synchronization.eventhandler.OrderEventHandler.onCreate(OrderEventHandler.java:100)
    at sun.reflect.GeneratedMethodAccessor278.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:267)
    at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)
    at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137)
    at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:263)
    at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:164)
    at org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(ForwardingWeldMethod.java:51)
    at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:154)
    at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:245)
    at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:233)
    at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:213)
    at org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:117)
    at org.jboss.weld.event.ObserverNotifier.notifyObservers(ObserverNotifier.java:85)
    at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:80)
    at org.jboss.weld.event.EventImpl.fire(EventImpl.java:69)
    at org.openbravo.client.kernel.event.PersistenceEventOBInterceptor.sendNewEvent(PersistenceEventOBInterceptor.java:93)
    at org.openbravo.client.kernel.event.PersistenceEventOBInterceptor.onSave(PersistenceEventOBInterceptor.java:82)
    at org.openbravo.client.kernel.event.PersistenceEventOBInterceptor$Proxy$_$$_WeldClientProxy.onSave(PersistenceEventOBInterceptor$Proxy$_$$_WeldClientProxy.java)
    at org.openbravo.dal.core.OBInterceptor.onSave(OBInterceptor.java:244)
    at org.hibernate.event.def.AbstractSaveEventListener.substituteValuesIfNecessary(AbstractSaveEventListener.java:413)
    at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:292)
    at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:203)
    at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:143)
    at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210)
    at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195)
    at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:117)
    at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
    at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:685)
    at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:677)
    at org.openbravo.dal.core.SessionHandler.save(SessionHandler.java:438)
    at org.openbravo.dal.service.OBDal.save(OBDal.java:303)
    at org.openbravo.advpaymentmngt.dao.AdvPaymentMngtDao.getNewPayment(AdvPaymentMngtDao.java:544)
    at org.openbravo.advpaymentmngt.process.FIN_AddPayment.savePayment(FIN_AddPayment.java:157)
    at org.openbravo.retail.posterminal.OrderLoader.processPayments(OrderLoader.java:2806)
    at org.openbravo.retail.posterminal.OrderLoader.handlePayments(OrderLoader.java:2404)
    at org.openbravo.retail.posterminal.OrderLoader.saveRecord(OrderLoader.java:542)
    at org.openbravo.mobile.core.process.DataSynchronizationProcess.saveRecord(DataSynchronizationProcess.java:200)
    at org.openbravo.mobile.core.process.DataSynchronizationProcess.exec(DataSynchronizationProcess.java:154)
    at org.openbravo.mobile.core.process.DataSynchronizationProcess.exec(DataSynchronizationProcess.java:86)
    at org.openbravo.mobile.core.process.JSONProcessSimple.exec(JSONProcessSimple.java:46)
    at org.openbravo.mobile.core.process.SecuredJSONProcess.secureExec(SecuredJSONProcess.java:60)
    at org.openbravo.mobile.core.process.MobileServiceProcessor.execProcess(MobileServiceProcessor.java:123)
    at org.openbravo.mobile.core.process.MobileServiceProcessor.execServiceName(MobileServiceProcessor.java:97)
    at org.openbravo.mobile.core.servercontroller.SynchronizedServerProcessCaller.execute(SynchronizedServerProcessCaller.java:71)
    at org.openbravo.mobile.core.servercontroller.MultiServerJSONProcess.executeLocal(MultiServerJSONProcess.java:790)
    at org.openbravo.mobile.core.servercontroller.MultiServerJSONProcess.executeFromWebPOSInCentral(MultiServerJSONProcess.java:397)
    at org.openbravo.mobile.core.servercontroller.MultiServerJSONProcess.exec(MultiServerJSONProcess.java:234)
    at org.openbravo.mobile.core.process.JSONProcessSimple.exec(JSONProcessSimple.java:46)
    at org.openbravo.mobile.core.process.SecuredJSONProcess.secureExec(SecuredJSONProcess.java:60)
    at org.openbravo.mobile.core.process.MobileServiceProcessor.execProcess(MobileServiceProcessor.java:123)
    at org.openbravo.mobile.core.process.MobileServiceProcessor.execServiceName(MobileServiceProcessor.java:97)
    at org.openbravo.mobile.core.process.MobileService.doGetOrPost(MobileService.java:148)
    at org.openbravo.mobile.core.process.MobileService.doPost(MobileService.java:68)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
    at org.openbravo.base.HttpBaseServlet.serviceInitialized(HttpBaseServlet.java:221)
    at org.openbravo.base.secureApp.HttpSecureAppServlet.service(HttpSecureAppServlet.java:462)
    at org.openbravo.client.kernel.BaseKernelServlet.callServiceInSuper(BaseKernelServlet.java:87)
    at org.openbravo.mobile.core.process.WebServiceAuthenticatedServlet.service(WebServiceAuthenticatedServlet.java:62)
    at org.openbravo.mobile.core.process.MobileService.service(MobileService.java:99)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.openbravo.utils.SessionExpirationFilter.doFilter(SessionExpirationFilter.java:66)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.openbravo.utils.CharsetFilter.doFilter(CharsetFilter.java:35)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.openbravo.client.kernel.KernelFilter$1.doAction(KernelFilter.java:62)
    at org.openbravo.dal.core.ThreadHandler.run(ThreadHandler.java:46)
    at org.openbravo.client.kernel.KernelFilter.doFilter(KernelFilter.java:71)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.openbravo.dal.core.DalRequestFilter$1.doAction(DalRequestFilter.java:81)
    at org.openbravo.dal.core.ThreadHandler.run(ThreadHandler.java:46)
    at org.openbravo.dal.core.DalRequestFilter.doFilter(DalRequestFilter.java:103)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:442)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1083)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:640)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:745)

[2]
https://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/file/tip/src/org/openbravo/retail/storeserver/synchronization/eventhandler/OrderEventHandler.java#l71 [^]

[3]
https://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/file/tip/src/org/openbravo/retail/storeserver/synchronization/utils/BusinessPartnerSegmentationUtils.java#l54 [^]
(0103118)
hgbot   
2018-03-09 10:24   
Repository: erp/pmods/org.openbravo.retail.storeserver.synchronization
Changeset: ce206adbbec085cbffcd6e095daf353fdbed3ddf
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Fri Mar 09 10:24:13 2018 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/ce206adbbec085cbffcd6e095daf353fdbed3ddf [^]

Fixes issue 37731: Flushes and refreshes DAL object only when needed

There problem was that a flush was being performed inside an event handler, and that does not work.

The flush was done initially because it was needed in the StoreBusinessPartnerLoaderHook, so now the BusinessPartnerSegmentationUtils
only flush when they are invoked from that class.

---
M src/org/openbravo/retail/storeserver/synchronization/StoreBusinessPartnerLoaderHook.java
M src/org/openbravo/retail/storeserver/synchronization/utils/BusinessPartnerSegmentationUtils.java
---
(0103142)
mtaal   
2018-03-09 22:03   
Reviewed and tested