Openbravo Issue Tracking System - Retail Modules
View Issue Details
0028324Retail ModulesWeb POSpublic2014-11-30 19:492014-12-01 11:06
mtaal 
mtaal 
normalmajorhave not tried
closedfixed 
5
 
RR15Q1RR15Q1 
marvintm
No
0028324: Source change detection breaks build, non-thread safe handling of js code generation
This issue was found while reviewing while the performance build was broken:
https://ci.openbravo.com/view/retail/job/ret-performance-pgsql/ [^]
https://ci.openbravo.com/view/retail/job/ret-performance-pgsql/ [^]

The source change resulted in that direct json webservice orderloader requests caused a NPE on the server. The getGeneratedJavascriptFilename method in the MobileStaticResourceComponent method expected the parameters of the MobileStaticResourceComponent to contain the ServletContext. This was not the case.

The code review also showed that the MobileStaticResourceComponent was ApplicationScoped but the parameters of the component were set at each request, resulting in potential unsafe thread behavior.
Do a direct webservice call to the orderloader, for example see the performance build jmeter files or use the POSOrderCashupPerformanceTest class.
Make sure that the parameters are set correctly when the static file name is generated.
Make the MobileStaticResourceComponent not application scoped anymore, so request based to prevent race conditions.
No tags attached.
caused by defect 0028251RR15Q1 closed marvintm Improved behavior of the Web POS update in case the user doesn't manually refresh the page after the update is done 
Issue History
2014-11-30 19:49mtaalNew Issue
2014-11-30 19:49mtaalAssigned To => mtaal
2014-11-30 19:49mtaalTriggers an Emergency Pack => No
2014-11-30 20:00mtaalRelationship addedcaused by 0028251
2014-11-30 20:03hgbotCheckin
2014-11-30 20:03hgbotNote Added: 0072165
2014-11-30 20:03hgbotStatusnew => resolved
2014-11-30 20:03hgbotResolutionopen => fixed
2014-11-30 20:03hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/6ea902cef0dfa499eaba07acdee8d89951489eb7 [^]
2014-12-01 11:06marvintmReview Assigned To => marvintm
2014-12-01 11:06marvintmStatusresolved => closed
2014-12-01 11:06marvintmFixed in Version => RR15Q1

Notes
(0072165)
hgbot   
2014-11-30 20:03   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 6ea902cef0dfa499eaba07acdee8d89951489eb7
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Sun Nov 30 20:03:29 2014 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/6ea902cef0dfa499eaba07acdee8d89951489eb7 [^]

Fixes issue 28324: Source change detection breaks build, non-thread safe handling of js code generation
Make MobileStaticResourceComponent request-thread-safe, move getParameterMap method to generic location, use
this method to make sure that the MobileStaticResourceComponent's parameters are set correctly.

---
M src/org/openbravo/mobile/core/MobileCoreComponentServlet.java
M src/org/openbravo/mobile/core/MobileCoreKernelUtils.java
M src/org/openbravo/mobile/core/MobileStaticResourceComponent.java
M src/org/openbravo/mobile/core/login/MobileCoreLoginHandler.java
M src/org/openbravo/mobile/core/process/JSONProcessSimple.java
---