Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0036610Openbravo ERPA. Platformpublic2017-08-04 13:422018-01-03 12:38
shuehner 
inigosanchez 
highminorhave not tried
closedfixed 
5
 
3.0PR18Q1 
alostale
Core
No
0036610: 3* flush called to insert/save 1 record in generated windows
Apart of reviewing if all 3 3 flushes are required.
Also interesting to check DAL session content i.e. in last 3rd flush to see if it is really required to load all those object into the session.

1.)
593613 [http-bio-8080-exec-1] INFO org.openbravo.dal.service.OBDal - Content of session: {ADTab=1}
593613 [http-bio-8080-exec-1] INFO org.openbravo.dal.service.OBDal - Flush of 1 entities and 12 collections took: 1
java.lang.Throwable
    at org.openbravo.dal.service.OBDal.flush(OBDal.java:293)
    at org.openbravo.service.json.DefaultJsonDataService.doPreAction(DefaultJsonDataService.java:1126)
    at org.openbravo.service.json.DefaultJsonDataService.update(DefaultJsonDataService.java:887)
    at org.openbravo.service.json.DefaultJsonDataService.add(DefaultJsonDataService.java:868)
    at org.openbravo.service.datasource.DefaultDataSourceService.add(DefaultDataSourceService.java:219)
    at org.openbravo.service.datasource.DefaultDataSourceService.add(DefaultDataSourceService.java:210)
    at org.openbravo.service.datasource.DataSourceServlet.doPost(DataSourceServlet.java:853)

2.)
593634 [http-bio-8080-exec-1] INFO org.openbravo.dal.service.OBDal - Content of session: {ADClient=2, ADLanguage=1, ADTab=1, ADUser=2, BusinessPartner=1, BusinessPartnerLocation=1, DocumentType=1, MaterialMgmtShipmentInOut=1, Organization=2, Warehouse=1}
593634 [http-bio-8080-exec-1] INFO org.openbravo.dal.service.OBDal - Flush of 13 entities and 327 collections took: 4
java.lang.Throwable
    at org.openbravo.dal.service.OBDal.flush(OBDal.java:293)
    at org.openbravo.service.json.DefaultJsonDataService.update(DefaultJsonDataService.java:935)
    at org.openbravo.service.json.DefaultJsonDataService.add(DefaultJsonDataService.java:868)
    at org.openbravo.service.datasource.DefaultDataSourceService.add(DefaultDataSourceService.java:219)
    at org.openbravo.service.datasource.DefaultDataSourceService.add(DefaultDataSourceService.java:210)
    at org.openbravo.service.datasource.DataSourceServlet.doPost(DataSourceServlet.java:853)

3.)
593649 [http-bio-8080-exec-1] INFO org.openbravo.dal.service.OBDal - Content of session: {ADClient=2, ADLanguage=1, ADUser=3, BusinessPartner=1, BusinessPartnerLocation=1, DocumentType=1, MaterialMgmtShipmentInOut=1, Organization=3, ShipmentInOut_ComputedColumns=1, Warehouse=1}
593649 [http-bio-8080-exec-1] INFO org.openbravo.dal.service.OBDal - Flush of 15 entities and 367 collections took: 2
java.lang.Throwable
    at org.openbravo.dal.service.OBDal.flush(OBDal.java:293)
    at org.openbravo.service.json.DefaultJsonDataService.doPostAction(DefaultJsonDataService.java:1137)
    at org.openbravo.service.json.DefaultJsonDataService.update(DefaultJsonDataService.java:1003)
    at org.openbravo.service.json.DefaultJsonDataService.add(DefaultJsonDataService.java:868)
    at org.openbravo.service.datasource.DefaultDataSourceService.add(DefaultDataSourceService.java:219)
    at org.openbravo.service.datasource.DefaultDataSourceService.add(DefaultDataSourceService.java:210)
    at org.openbravo.service.datasource.DataSourceServlet.doPost(DataSourceServlet.java:853)

593657 [http-bio-8080-exec-1] INFO org.openbravo.dal.core.DalRequestFilter - request= /openbravo/org.openbravo.service.datasource/MaterialMgmtShipmentInOut?windowId=169&tabId=257&moduleId=0&_operationType=update&_noActiveFilter=true&sendOriginalIDBack=true&_extraProperties=&Constants_FIELDSEPARATOR=%24&_className=OBViewDataSource&Constants_IDENTIFIER=_identifier&isc_dataFormat=json flushCount: 3 requestTime: 62
Use new in Goods Shipment window
fill out mandatory fields
Press 'Save' and trace flushes
Performance
blocks design defect 0036606 new platform Clean up extra not requires flush() calls 
Issue History
2017-08-04 13:42shuehnerNew Issue
2017-08-04 13:42shuehnerAssigned To => platform
2017-08-04 13:42shuehnerModules => Core
2017-08-04 13:42shuehnerTriggers an Emergency Pack => No
2017-08-04 13:42shuehnerRelationship addedblocks 0036606
2017-08-10 12:08alostaleNote Added: 0098474
2017-08-10 12:09alostaleStatusnew => acknowledged
2017-08-10 12:09alostalePrioritynormal => high
2017-08-10 12:09alostaleTag Attached: Performance
2017-09-28 17:59inigosanchezStatusacknowledged => scheduled
2017-09-28 17:59inigosanchezAssigned Toplatform => inigosanchez
2017-10-06 10:12hgbotCheckin
2017-10-06 10:12hgbotNote Added: 0099785
2017-10-06 10:13hgbotCheckin
2017-10-06 10:13hgbotNote Added: 0099786
2017-10-06 10:13hgbotStatusscheduled => resolved
2017-10-06 10:13hgbotResolutionopen => fixed
2017-10-06 10:13hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/34c067c8eef2b09687cb72e5aad89225502726eb [^]
2017-10-06 10:15inigosanchezReview Assigned To => alostale
2017-10-06 14:39alostaleNote Added: 0099805
2017-10-06 14:39alostaleStatusresolved => closed
2017-10-06 14:39alostaleFixed in Version => 3.0PR18Q1
2018-01-03 12:38hudsonbotCheckin
2018-01-03 12:38hudsonbotNote Added: 0101320

Notes
(0098474)
alostale   
2017-08-10 12:08   
Those flushes were added for pre/post actions, which in most of the cases are unimplemented.

Removing those would improve the common case but it would require to review those implementors to move flushes there where required.
(0099785)
hgbot   
2017-10-06 10:12   
Repository: erp/pmods/org.openbravo.module.resources
Changeset: e1537bdb01944ba98e7b0f18f795e65e86cf9cec
Author: Inigo Sanchez <inigo.sanchez <at> openbravo.com>
Date: Fri Oct 06 09:55:46 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.module.resources/rev/e1537bdb01944ba98e7b0f18f795e65e86cf9cec [^]

Related with issue 36610: extra flushes are called in generated windows

Those flushes are added for pre/post actions because core ones in DefaultJsonDataService class are
removed in order to improve the common case.

From now on the flushes should be managed in every implementation of the pre/post actions hooks.

---
M src/org/openbravo/module/resources/calendar/ResourcesCalendarDataService.java
---
(0099786)
hgbot   
2017-10-06 10:13   
Repository: erp/devel/pi
Changeset: 34c067c8eef2b09687cb72e5aad89225502726eb
Author: Inigo Sanchez <inigo.sanchez <at> openbravo.com>
Date: Fri Oct 06 09:56:55 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/34c067c8eef2b09687cb72e5aad89225502726eb [^]

Fixed issue 36610: 3* flush called to insert/save 1 record in generated windows

Those flushes were added for pre/post actions, which in most of the cases are unimplemented. For this
reason, removing those two flushes would improve the common case.

After removing those flushes, it is required to move those flushes to pre/post actions implemented in
org.openbravo.module.resources module.

The problem has been resolved because the extra flushes are removed.

---
M modules/org.openbravo.service.json/src/org/openbravo/service/json/DefaultJsonDataService.java
---
(0099805)
alostale   
2017-10-06 14:39   
reviewed
(0101320)
hudsonbot   
2018-01-03 12:38   
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/c81e0d3cbab5 [^]
Maturity status: Test