Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0033051Openbravo ERPA. Platformpublic2016-05-25 15:422016-12-20 15:16
NaroaIriarte 
NaroaIriarte 
normalminoralways
closedfixed 
5
 
3.0PR16Q3 
alostale
Core
No
0033051: The security check is called twice when opening a window or refreshing it
The HttpSecureAppServlet.hasGeneralAccess security method is called twice when, for example, the sales order window is refreshed.
1-As F&B Administrator go to Sales Order window.
2-Note that there are a lot of queries, this is (in part) because the HttpSecureAppServlet.hasGeneralAccess method is being accessed twice instead once.
-The security check must be done once instead twice, this will decrease the uneeded queries.
Performance
related to defect 00317693.0PR16Q3 closed NaroaIriarte Unneeded left joins in DefaultJsonDataService 
related to defect 0033081 acknowledged Triage Platform Base There are some sql queries that can be avoided. 
Issue History
2016-05-25 15:42NaroaIriarteNew Issue
2016-05-25 15:42NaroaIriarteAssigned To => NaroaIriarte
2016-05-25 15:42NaroaIriarteModules => Core
2016-05-25 15:42NaroaIriarteTriggers an Emergency Pack => No
2016-05-25 15:44NaroaIriarteStatusnew => acknowledged
2016-05-25 17:13alostaleTag Attached: Performance
2016-05-25 17:14alostaleRelationship addedrelated to 0031769
2016-05-30 18:03hgbotCheckin
2016-05-30 18:03hgbotNote Added: 0086823
2016-05-30 18:03hgbotStatusacknowledged => resolved
2016-05-30 18:03hgbotResolutionopen => fixed
2016-05-30 18:03hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/020004e453ca55652ce3b45a4bb91078af693905 [^]
2016-05-31 08:16alostaleReview Assigned To => alostale
2016-05-31 08:16alostaleNote Added: 0086847
2016-05-31 08:16alostaleStatusresolved => closed
2016-05-31 08:16alostaleFixed in Version => 3.0PR16Q3
2016-06-17 19:37hudsonbotCheckin
2016-06-17 19:37hudsonbotNote Added: 0087573
2016-12-20 15:16NaroaIriarteRelationship addedrelated to 0033081

Notes
(0086823)
hgbot   
2016-05-30 18:03   
Repository: erp/devel/pi
Changeset: 020004e453ca55652ce3b45a4bb91078af693905
Author: Naroa Iriarte <naroa.iriarte <at> openbravo.com>
Date: Wed May 25 15:57:12 2016 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/020004e453ca55652ce3b45a4bb91078af693905 [^]

Fixed issue 33051: The "hasGeneralAccess" method is called twice

The HttpSecureAppServlet.hasGeneralAccess method is called twice
when a window is refresed or opened, for example "Sales Order".
This is not rigth because it executes more queries than needed.
To fix this a piece of code have been refactored in the "DataSourceServlet"
class.
In the "doPost" method, there is a call to the "hasAccess" method, this method
is the one which calls the "hasGeneralAccess" and this is the one that is called twice.
The problem was that inside the "doPost" method exists also a call to the "doFetch" method,
this method calls the "hasAccess" method and this calls the "hasGeneralAccess" method.
So, when the doPost method called the fetch method, the "hasGeneralAcces" method was executed
twice because of the call inside the "doPost" and the call inside the "doFetch" method.

This has been fixed by moving the code which was doing the call to "hasAccess" inside
the "doPost" method, now it has been placed after the call to the "doFetch".

---
M modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/DataSourceServlet.java
---
(0086847)
alostale   
2016-05-31 08:16   
code reviewed + tested
(0087573)
hudsonbot   
2016-06-17 19:37   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/0dc7be081b1c [^]
Maturity status: Test