Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0036601Openbravo ERPA. Platformpublic2017-08-04 10:042017-08-04 12:46
alostale 
alostale 
normalminorhave not tried
closedfixed 
5
 
3.0PR17Q4 
caristu
Core
No
0036601: unneeded flush with no entities on every fetch
Whenever datasoruce data is fetched, a flush is performed just after clearing the session. This actually has no effect as it's guaranteed session to be empty, so there's nothing to flush.
1. Open Product window
2. Set OBDal class debug level to DEBUG
3. Click on Product's Refresh grid toolbar button
  -> check openbravo.log:

1f923ef8 690457 [http-bio-8080-exec-1] DEBUG org.openbravo.dal.service.OBDal - Dumping all entities in session
1f923ef8 690458 [http-bio-8080-exec-1] DEBUG org.openbravo.dal.service.OBDal - Flush of 0 entities and 0 collections took: 0
java.lang.Throwable
    at org.openbravo.dal.service.OBDal.flush(OBDal.java:268)
    at org.openbravo.service.json.DefaultJsonDataService.doPostAction(DefaultJsonDataService.java:1138)
    at org.openbravo.service.json.DefaultJsonDataService.fetch(DefaultJsonDataService.java:311)
Despite the performance impact is small, being unneeded it should be prevented.
Performance
related to defect 00265483.0PR14Q3 closed guillermogil Slow flush after a fetch to a datasource. 
blocks design defect 0036606 new platform Clean up extra not requires flush() calls 
Issue History
2017-08-04 10:04alostaleNew Issue
2017-08-04 10:04alostaleAssigned To => platform
2017-08-04 10:04alostaleModules => Core
2017-08-04 10:04alostaleTriggers an Emergency Pack => No
2017-08-04 10:04alostaleReview Assigned To => caristu
2017-08-04 10:04alostaleTag Attached: Performance
2017-08-04 10:05alostaleRelationship addedrelated to 0026548
2017-08-04 10:08alostaleAssigned Toplatform => alostale
2017-08-04 10:30alostaleStatusnew => scheduled
2017-08-04 10:34alostaleNote Added: 0098388
2017-08-04 10:34alostaleStatusscheduled => resolved
2017-08-04 10:34alostaleFixed in SCM revision => https://code.openbravo.com/erp/devel/pi/rev/b74ed74f842a [^]
2017-08-04 10:34alostaleResolutionopen => fixed
2017-08-04 12:46caristuNote Added: 0098392
2017-08-04 12:46caristuStatusresolved => closed
2017-08-04 12:46caristuFixed in Version => 3.0PR17Q4
2017-08-04 13:16shuehnerRelationship addedblocks 0036606

Notes
(0098388)
alostale   
2017-08-04 10:34   
https://code.openbravo.com/erp/devel/pi/rev/b74ed74f842a [^]
changeset: 32535:b74ed74f842a
tag: tip
user: Asier Lostalé <asier.lostale@openbravo.com>
date: Fri Aug 04 10:11:28 2017 +0200
files: modules/org.openbravo.service.json/src/org/openbravo/service/json/DefaultJsonDataService.java
description:
fixed 36601: unneeded flush with no entities on every fetch

  Fix includes:
   - Do not flush on fetch just after clearing session as it is noop
   - Being action an enum can be directly compared without need of getting its name
(0098392)
caristu   
2017-08-04 12:46   
Code reviewed + tested OK.