Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0028539
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Retail Modules] Web POSminorsometimes2015-01-08 10:502015-03-27 12:33
ReporteraaroncaleroView Statuspublic 
Assigned Toaaroncalero 
PrioritynormalResolutionfixedFixed in VersionRR15Q2
StatusclosedFix in branchFixed in SCM revision368bb8e4468a
ProjectionnoneETAnoneTarget VersionRR15Q2
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned ToOrekaria
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0028539: If syncAllModels is called before a previous execution has finished, the same data is sent twice to the server

DescriptionIf syncAllModels is called before a previous execution has finished and the data is not synchronized yet (OB.MobileApp.model.dataSynchronized is false), the same data is sent to the backend twice and the second time the data is being processed, several server errors are raised.
Steps To ReproduceCreate several tickets (30+) in webPOS while in offline mode.
Conect again to the server.
Before the synchronization process has finished, create a new ticket.
The following error will raise on the server:
*postgres database
2015-01-07 18:34:06,869 [TP-Processor5] ERROR org.hibernate.util.JDBCExceptionReporter - Batch entry 0 insert into C_Order (AD_Client_ID, AD_Org_ID, IsActive, CreatedBy, Updated, UpdatedBy, IsSOTrx, DocumentNo, DocStatus, DocAction, Processing, Processed, C_DocType_ID, C_DocTypeTarget_ID, Description, IsDelivered, IsInvoiced, IsPrinted, IsSelected, SalesRep_ID, DateOrdered, DatePromised, DateAcct, C_BPartner_ID, BillTo_ID, C_BPartner_Location_ID, IsDiscountPrinted, C_Currency_ID, PaymentRule, C_PaymentTerm_ID, InvoiceRule, DeliveryRule, FreightCostRule, DeliveryViaRule, ChargeAmt, PriorityRule, TotalLines, GrandTotal, M_Warehouse_ID, M_PriceList_ID, IsTaxIncluded, Posted, AD_User_ID, CopyFrom, IsSelfService, Generatetemplate, CopyFromPO, FIN_Paymentmethod_ID, RM_PickFromShipment, RM_ReceiveMaterials, RM_CreateInvoice, RM_AddOrphanLine, Calculate_Promotions, Convertquotation, Create_POLines, EM_Obdisc_Addpack, Iscashvat, RM_Pickfromreceipt, EM_APRM_AddPayment, EM_Obpos_Applications_ID, EM_Obpos_App_Cashup_ID, EM_Obpos_Sendemail, EM_Obpos_Createdabsolute, C_Order_ID) values ('39363B0921BB4293B48383844325E84C', 'D270A5AC50874F8BA67A88EE977F8E3B', 'Y', '3073EDF96A3C42CC86C7069E379522D2', '2015-01-07 18:34:06.129000 +00:00:00', '3073EDF96A3C42CC86C7069E379522D2', 'Y', 'VBS1/0000624', 'CO', '--', 'N', 'Y', '511A9371A0F74195AA3F6D66C722729D', '511A9371A0F74195AA3F6D66C722729D', '', 'N', 'N', 'Y', 'N', '3073EDF96A3C42CC86C7069E379522D2', '2015-01-07 00:00:00.000000 +00:00:00', '2015-01-07 00:00:00.000000 +00:00:00', '2015-01-07 00:00:00.000000 +00:00:00', 'ABD91C9D3BC94175B876FBBE9CACA008', '2AA7EADDF7EC405899262DDA3E572436', '2AA7EADDF7EC405899262DDA3E572436', 'N', '102', 'B', 'D8955F8808A54C63BBF478A6843D834D', 'I', 'A', 'I', 'P', '0', '5', '201.58', '243.90', 'CE7AB151695342FF879938F837F12E6E', '496CF965DF9744D2A41248392D1DE407', 'Y', 'N', '032576220FC44B0DA80145B3265E4D9A', 'N', 'N', 'N', 'N', '45A202BF44884F05B8A1BF741E2063B6', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', '9104513C2D0741D4850AE8493998A7C8', 'D2B699745521589F3A4F3ADAF0982E34', 'N', '2015-01-07 18:34:03.396000 +00:00:00', '18E7A199C39CB15BD5D1F8EA42DFCFD7') was aborted. Call getNextException to see the cause.
2015-01-07 18:34:06,877 [TP-Processor5] ERROR org.hibernate.util.JDBCExceptionReporter - ERROR: duplicate key value violates unique constraint "c_order_key"

*oracle database
2015-01-05 16:13:43,984 [TP-Processor1] ERROR org.hibernate.util.JDBCExceptionReporter - ORA-00001: unique constraint (RET_TEST_ORACLE.C_ORDER_KEY) violated
Proposed SolutionWe need to ensure that the syncAllModels function is not executed in parallel.
If it is called while the synchronization is in progress (meaning that there is something else that should be sync'ed), we need to activate a flag to call syncAllModels again after the first execution has finished.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
duplicate of defect 0029290 closedOrekaria Stabilization: The 'OB.MobileApp.model.syncAllModels' process should be executed once 
depends on feature request 0028217 newRetail Stabilization: Create a basic API for the asynchronous calls 
related to defect 0028692 closedmigueldejuana Message about Data Synchronization is shown before the actual synchronization happens 
Not all the children of this issue are yet resolved or closed.

-  Notes
(0073352)
hgbot (developer)
2015-01-08 11:46

Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 368bb8e4468a326c5b1c4e749fb85ff9d9c7fe7d
Author: Aaron Calero <aaron.calero <at> openbravo.com>
Date: Thu Jan 08 10:59:38 2015 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/368bb8e4468a326c5b1c4e749fb85ff9d9c7fe7d [^]

Fixed issue 28539: If syncAllModels is called before a previous execution has finished, the same data is sent twice to the server

Added an if condition to check if the dataSynchronized variable is true. If it's true, we can safely call syncModel to synchronize all data; if it's false, we activate the synchronizationPending flag to call syncAllModels again after the first execution has finished.

---
M web/org.openbravo.mobile.core/source/model/ob-terminal-model.js
---
(0073419)
Orekaria (administrator)
2015-01-12 13:01
edited on: 2015-01-12 13:06

Complex nested asynchronous calls and semaphores without the proper structure lead to hidden, hard to diagnose, breaking flow behaviour

As the SynchronizationHelper was born to address this flow requirements, that class should be improved to house this particular use case (the status of the server synchronization). The 'dataSynchronized' variable would be substituted (it wasn't possible due to Q1 time constraints)

(0073507)
hgbot (developer)
2015-01-15 08:09

Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 39cc6c6da0fcc9c333fece0859d17933617643b2
Author: Rafa Alonso <rafael.alonso <at> openbravo.com>
Date: Tue Jan 13 11:02:28 2015 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/39cc6c6da0fcc9c333fece0859d17933617643b2 [^]

Related to issue 28539: Backed out changeset: 368bb8e4468a, rev 1111
- this changeset seems to provoke webpos hangs when synchronizing

---
M web/org.openbravo.mobile.core/source/model/ob-terminal-model.js
---

- Issue History
Date Modified Username Field Change
2015-01-08 10:50 aaroncalero New Issue
2015-01-08 10:50 aaroncalero Assigned To => aaroncalero
2015-01-08 10:50 aaroncalero Triggers an Emergency Pack => No
2015-01-08 11:46 hgbot Checkin
2015-01-08 11:46 hgbot Note Added: 0073352
2015-01-08 11:46 hgbot Status new => resolved
2015-01-08 11:46 hgbot Resolution open => fixed
2015-01-08 11:46 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/368bb8e4468a326c5b1c4e749fb85ff9d9c7fe7d [^]
2015-01-12 13:01 Orekaria Note Added: 0073419
2015-01-12 13:01 Orekaria Status resolved => new
2015-01-12 13:01 Orekaria Resolution fixed => open
2015-01-12 13:04 Orekaria Note Edited: 0073419 View Revisions
2015-01-12 13:06 Orekaria Note Edited: 0073419 View Revisions
2015-01-15 08:09 hgbot Checkin
2015-01-15 08:09 hgbot Note Added: 0073507
2015-01-20 16:00 Orekaria Relationship added related to 0028692
2015-01-20 16:03 Orekaria Relationship added depends on 0028217
2015-01-20 16:06 Orekaria Relationship deleted related to 0028692
2015-01-20 16:07 Orekaria Relationship added related to 0028692
2015-03-27 08:56 aaroncalero Relationship added duplicate of 0029290
2015-03-27 12:33 Orekaria Review Assigned To => Orekaria
2015-03-27 12:33 Orekaria Status new => closed
2015-03-27 12:33 Orekaria Resolution open => fixed
2015-03-27 12:33 Orekaria Fixed in Version => RR15Q2


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker