[view] clean up DAL session after view generation to speed up flush
authorAsier Lostalé <asier.lostale@openbravo.com>
Fri, 03 Aug 2018 09:48:00 +0200
changeset 35061 901a7335da1a
parent 35060 ad90890155ff
child 35062 a3107f6ba3a1
[view] clean up DAL session after view generation to speed up flush
modules/org.openbravo.client.application/src/org/openbravo/client/application/ViewComponent.java
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/ViewComponent.java	Thu Aug 02 15:43:55 2018 +0200
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/ViewComponent.java	Fri Aug 03 09:48:00 2018 +0200
@@ -110,6 +110,9 @@
         return generateView(viewId);
       }
     } finally {
+      // view generation is read only, remove from session whatever DAL loaded to make faster flush
+      OBDal.getInstance().getSession().clear();
+
       OBContext.restorePreviousMode();
       log.debug("View {} generated in {} ms", viewId, System.currentTimeMillis() - t);
     }