Openbravo Issue Tracking System - Retail Modules
View Issue Details
0029280Retail ModulesWeb POSpublic2015-03-13 19:592015-03-27 17:06
Orekaria 
Orekaria 
normalminoralways
closedfixed 
5
 
RR15Q2 
marvintm
No
0029280: Stabilization: Session related management requires a synchronous flow
Stabilization: Session related management requires a synchronous flow

There are session related exceptions that seams to be provoked by the asynchronous nature of the local database
In OB.Dal.find mofify:
  executeSqlErrorHandler('warn', "OB.Dal.find: table", tableName, txError, e);
with
  executeSqlErrorHandler('error', "OB.Dal.find: table", tableName, txError, e);

Run the tests. Verify that there are 'session' related errors. E.g:

OB.Dal.save: table 'ad_session'; {"message":"could not prepare statement (1 no such table: ad_session)","code":5}
No tags attached.
depends on defect 0029055RR15Q2 closed marvintm Web POS doesn't handle update of local database tables correctly 
depends on defect 0029346 acknowledged Retail Stabilization: OB.Dal.initCache should execute the callback when all the flow paths have finished 
depends on feature request 0029281 closed Orekaria Stabilization: Raise the log level of the OB.Dal.find errors, from 'warn' to 'error' 
blocks feature request 0029377RR15Q3 closed Orekaria Stabilization: RR15Q2 related 
Not all the children of this issue are yet resolved or closed.
Issue History
2015-03-13 19:59OrekariaNew Issue
2015-03-13 19:59OrekariaAssigned To => Orekaria
2015-03-13 19:59OrekariaTriggers an Emergency Pack => No
2015-03-13 22:42OrekariaRelationship addeddepends on 0029055
2015-03-13 22:59hgbotCheckin
2015-03-13 22:59hgbotNote Added: 0075585
2015-03-13 22:59hgbotStatusnew => resolved
2015-03-13 22:59hgbotResolutionopen => fixed
2015-03-13 22:59hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/3a2055ff8dfdf99e8f89b052e34ee5c6a52adc31 [^]
2015-03-16 15:09OrekariaNote Added: 0075628
2015-03-16 15:09OrekariaStatusresolved => new
2015-03-16 15:09OrekariaResolutionfixed => open
2015-03-16 17:49adrianromeroNote Added: 0075646
2015-03-18 13:32OrekariaNote Deleted: 0075628
2015-03-19 12:33OrekariaRelationship addedrelated to 0029346
2015-03-19 13:06OrekariaRelationship replaceddepends on 0029346
2015-03-20 19:12hgbotCheckin
2015-03-20 19:12hgbotNote Added: 0075828
2015-03-23 14:52OrekariaRelationship addedblocks 0029377
2015-03-24 18:35OrekariaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=8093#r8093
2015-03-24 18:35OrekariaRelationship addeddepends on 0029281
2015-03-24 20:32hgbotCheckin
2015-03-24 20:32hgbotNote Added: 0075945
2015-03-25 09:08OrekariaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=8100#r8100
2015-03-25 16:12OrekariaStatusnew => scheduled
2015-03-25 16:12OrekariaStatusscheduled => resolved
2015-03-25 16:12OrekariaFixed in Version => RR15Q2
2015-03-25 16:12OrekariaResolutionopen => fixed
2015-03-27 17:06marvintmReview Assigned To => marvintm
2015-03-27 17:06marvintmStatusresolved => closed

Notes
(0075585)
hgbot   
2015-03-13 22:59   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 3a2055ff8dfdf99e8f89b052e34ee5c6a52adc31
Author: Rafa Alonso <rafael.alonso <at> openbravo.com>
Date: Fri Mar 13 20:19:30 2015 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/3a2055ff8dfdf99e8f89b052e34ee5c6a52adc31 [^]

Fixes issue 29280: Session related operations are synchronous

---
M web/org.openbravo.mobile.core/source/model/ob-terminal-model.js
---
(0075646)
adrianromero   
2015-03-16 17:49   
Here the function setUserModeOnline is invoked and in the callback the updateSession function is invoked: https://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/file/3a2055ff8dfd/web/org.openbravo.mobile.core/source/model/ob-terminal-model.js#l342 [^]

But the function setUserModeOnline also invokes updateSession: https://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/file/3a2055ff8dfd/web/org.openbravo.mobile.core/source/model/ob-terminal-model.js#l1348 [^]

It seems to be redundant either one invocation or the other

Also, the function setUserModeOnline contains an 'if' and in both blocks of this 'if' expression the function "OB.Dal.save(user, function () ..." is invoked but only in one block the function updateSession is invoked. This also seems incorrect and must be reviewed.
https://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/file/3a2055ff8dfd/web/org.openbravo.mobile.core/source/model/ob-terminal-model.js#l1325 [^]
https://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/file/3a2055ff8dfd/web/org.openbravo.mobile.core/source/model/ob-terminal-model.js#l1347 [^]
(0075828)
hgbot   
2015-03-20 19:12   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: c668e54425cbee2f0dd05a755150a84472789a9d
Author: Rafa Alonso <rafael.alonso <at> openbravo.com>
Date: Fri Mar 20 17:15:24 2015 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/c668e54425cbee2f0dd05a755150a84472789a9d [^]

Related to issue 29280: 'setUserModelOnline' fixes

- the updateSession was being executed twice
- the 'setUserModelOnline' will save the session with the user

---
M web/org.openbravo.mobile.core/source/model/ob-terminal-model.js
---
(0075945)
hgbot   
2015-03-24 20:32   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: d2295f8757b10a4202a647ddf8522c1890eefc8a
Author: Rafa Alonso <rafael.alonso <at> openbravo.com>
Date: Tue Mar 24 19:57:29 2015 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/d2295f8757b10a4202a647ddf8522c1890eefc8a [^]

Related to issue 29280: Better save flow in the 'updateSession' method

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