Openbravo Issue Tracking System - Retail Modules
View Issue Details
0038389Retail ModulesWeb POSpublic2018-04-17 12:482018-05-17 17:44
alostale 
marvintm 
normalminorhave not tried
closedfixed 
5
 
RR18Q3 
guilleaer
No
0038389: DB connection unnecessarily retained while reading request contents
A database connection is unnecessarily retained while reading POS JSON request contents. In situations of slow network or big requests, this can cause an overhead on the number of open DB connections.
1. Enable pool jmx monitoring: in Openbravo.properties set db.pool.jmxEnabled=true and monitor active pool connections
2. Log in WebPOS
3. Simulate slow network by setting browser's network throttilng
4. Generate big log client to be sent, ie. execute:
  for (var i =0;i<500;i++) {
    var s = i + '-'
    for (var j=0; j<4096; j++) s += 'c'
    OB.warn(s)
  }
5. Wait till log client is sent to backend:
  -> Check during the time the request is being read, an active connection is always kept
As DB connection is not needed while reading request contents, it could be released while reading to be obtained afterwards if required.
Performance
related to design defect 0038390 closed marvintm request timeout is checked only after reading the whole request content 
? 38389.export (1,142) 2018-04-17 12:52
https://issues.openbravo.com/file_download.php?file_id=11741&type=bug
Issue History
2018-04-17 12:48alostaleNew Issue
2018-04-17 12:48alostaleAssigned To => Retail
2018-04-17 12:48alostaleTriggers an Emergency Pack => No
2018-04-17 12:48alostaleTag Attached: Performance
2018-04-17 12:52alostaleFile Added: 38389.export
2018-04-17 12:52alostaleNote Added: 0103933
2018-04-17 13:03alostaleRelationship addedrelated to 0038390
2018-05-04 13:10hgbotCheckin
2018-05-04 13:10hgbotNote Added: 0104280
2018-05-04 13:10hgbotStatusnew => resolved
2018-05-04 13:10hgbotResolutionopen => fixed
2018-05-04 13:10hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/8294126722991ded08a597a49c4382e986b188ce [^]
2018-05-04 15:25marvintmAssigned ToRetail => marvintm
2018-05-17 17:44guilleaerReview Assigned To => guilleaer
2018-05-17 17:44guilleaerStatusresolved => closed
2018-05-17 17:44guilleaerFixed in Version => RR18Q3

Notes
(0103933)
alostale   
2018-04-17 12:52   
Attached proposed solution to be tested
(0104280)
hgbot   
2018-05-04 13:10   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 8294126722991ded08a597a49c4382e986b188ce
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Tue Apr 17 12:49:56 2018 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/8294126722991ded08a597a49c4382e986b188ce [^]

fixes 38389: DB connection unnecessarily retained while reading request content

  DB connection can be released while reading request content as it is not necessary
  and reading it is potentially slow.

---
M src/org/openbravo/mobile/core/process/WebServiceAuthenticatedServlet.java
---