Author: jleroux
Date: Tue Nov 25 09:15:10 2014
New Revision: 1641549

URL: http://svn.apache.org/r1641549
Log:
"Applied fix from trunk for revision: 1641548" 
------------------------------------------------------------------------
r1641548 | jleroux | 2014-11-25 10:14:36 +0100 (mar. 25 nov. 2014) | 3 lignes

A patch from  Deepak Dixit for "EntityListIterator Not Closed for Entity 
JobSandbox, caught in Finalize" https://issues.apache.org/jira/browse/OFBIZ-5885

EntityListIterator Not Closed for Entity JobSandbox in ServiceUtil.purgeOldJobs 
method. Need to close the entity list iterator properly.
------------------------------------------------------------------------


Modified:
    ofbiz/branches/release13.07/   (props changed)
    
ofbiz/branches/release13.07/framework/service/src/org/ofbiz/service/ServiceUtil.java

Propchange: ofbiz/branches/release13.07/
------------------------------------------------------------------------------
  Merged /ofbiz/trunk:r1641548

Modified: 
ofbiz/branches/release13.07/framework/service/src/org/ofbiz/service/ServiceUtil.java
URL: 
http://svn.apache.org/viewvc/ofbiz/branches/release13.07/framework/service/src/org/ofbiz/service/ServiceUtil.java?rev=1641549&r1=1641548&r2=1641549&view=diff
==============================================================================
--- 
ofbiz/branches/release13.07/framework/service/src/org/ofbiz/service/ServiceUtil.java
 (original)
+++ 
ofbiz/branches/release13.07/framework/service/src/org/ofbiz/service/ServiceUtil.java
 Tue Nov 25 09:15:10 2014
@@ -425,11 +425,14 @@ public class ServiceUtil {
                     // begin this transaction
                     beganTx1 = TransactionUtil.begin();
 
-                    EntityListIterator foundJobs = 
delegator.find("JobSandbox", mainCond, null, UtilMisc.toSet("jobId"), null, 
findOptions);
+                    EntityListIterator foundJobs = null;
                     try {
+                        foundJobs = delegator.find("JobSandbox", mainCond, 
null, UtilMisc.toSet("jobId"), null, findOptions);
                         curList = foundJobs.getPartialList(1, 1000);
                     } finally {
-                        foundJobs.close();
+                        if (foundJobs != null) {
+                            foundJobs.close();
+                         }
                     }
                 } catch (GenericEntityException e) {
                     Debug.logError(e, "Cannot obtain job data from 
datasource", module);


Reply via email to