svn commit: r1652362 - in /ofbiz/branches/release14.12: ./ framework/entity/src/org/ofbiz/entity/GenericDelegator.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1652362 - in /ofbiz/branches/release14.12: ./ framework/entity/src/org/ofbiz/entity/GenericDelegator.java

jacopoc
Author: jacopoc
Date: Fri Jan 16 08:35:58 2015
New Revision: 1652362

URL: http://svn.apache.org/r1652362
Log:
Applied fix from trunk for revision: 1652361
===

Modified code to make sure the EntityListIterator is always closed after being used.
Thanks to Deepak Dixit and Nameet Jain for spotting the issue and identifying the offending code.



Modified:
    ofbiz/branches/release14.12/   (props changed)
    ofbiz/branches/release14.12/framework/entity/src/org/ofbiz/entity/GenericDelegator.java

Propchange: ofbiz/branches/release14.12/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jan 16 08:35:58 2015
@@ -8,4 +8,4 @@
 /ofbiz/branches/json-integration-refactoring:1634077-1635900
 /ofbiz/branches/multitenant20100310:921280-927264
 /ofbiz/branches/release13.07:1547657
-/ofbiz/trunk:1649742,1650240,1650583,1650642,1650678,1650882,1650887,1650938,1651593
+/ofbiz/trunk:1649742,1650240,1650583,1650642,1650678,1650882,1650887,1650938,1651593,1652361

Modified: ofbiz/branches/release14.12/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release14.12/framework/entity/src/org/ofbiz/entity/GenericDelegator.java?rev=1652362&r1=1652361&r2=1652362&view=diff
==============================================================================
--- ofbiz/branches/release14.12/framework/entity/src/org/ofbiz/entity/GenericDelegator.java (original)
+++ ofbiz/branches/release14.12/framework/entity/src/org/ofbiz/entity/GenericDelegator.java Fri Jan 16 08:35:58 2015
@@ -1805,10 +1805,18 @@ public class GenericDelegator implements
                 beganTransaction = TransactionUtil.begin();
             }
 
-            EntityListIterator eli = this.find(entityName, entityCondition, null, fieldsToSelect, orderBy, findOptions);
-            eli.setDelegator(this);
-            List<GenericValue> list = eli.getCompleteList();
-            eli.close();
+            EntityListIterator eli = null;
+            List<GenericValue> list = null;
+            try {
+                eli = this.find(entityName, entityCondition, null, fieldsToSelect, orderBy, findOptions);
+                list = eli.getCompleteList();
+            } finally {
+                if (eli != null) {
+                    try {
+                        eli.close();
+                    } catch (Exception exc) {}
+                }
+            }
 
             if (useCache) {
                 ecaRunner.evalRules(EntityEcaHandler.EV_CACHE_PUT, EntityEcaHandler.OP_FIND, dummyValue, false);