details: https://code.openbravo.com/erp/devel/pi/rev/9c7cda930438 changeset: 21213:9c7cda930438 user: Asier Lostalé <asier.lostale <at> openbravo.com> date: Fri Sep 27 15:49:39 2013 +0200 summary: fixed bug 24842: custom query selector raises LazyInitializationException
diffstat: modules/org.openbravo.userinterface.selector/src/org/openbravo/userinterface/selector/CustomQuerySelectorDatasource.java | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diffs (22 lines): diff -r a37b6649b7c7 -r 9c7cda930438 modules/org.openbravo.userinterface.selector/src/org/openbravo/userinterface/selector/CustomQuerySelectorDatasource.java --- a/modules/org.openbravo.userinterface.selector/src/org/openbravo/userinterface/selector/CustomQuerySelectorDatasource.java Fri Sep 27 14:18:34 2013 +0200 +++ b/modules/org.openbravo.userinterface.selector/src/org/openbravo/userinterface/selector/CustomQuerySelectorDatasource.java Fri Sep 27 15:49:39 2013 +0200 @@ -34,6 +34,7 @@ import org.codehaus.jettison.json.JSONArray; import org.codehaus.jettison.json.JSONException; import org.codehaus.jettison.json.JSONObject; +import org.hibernate.Hibernate; import org.hibernate.Query; import org.hibernate.ScrollMode; import org.hibernate.ScrollableResults; @@ -91,6 +92,10 @@ List<SelectorField> fields = OBDao.getActiveOBObjectList(sel, Selector.PROPERTY_OBUISELSELECTORFIELDLIST); + // Forcing object initialization to prevent LazyInitializationException in case session is + // cleared when number of records is big enough + Hibernate.initialize(fields); + // Parse the HQL in case that optional filters are required String HQL = parseOptionalFilters(parameters, sel, xmlDateFormat); ------------------------------------------------------------------------------ October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk _______________________________________________ Openbravo-commits mailing list Openbravo-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbravo-commits