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.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1641548 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jacques Le Roux
2014-11-25 09:14:36 +00:00
parent f25a007030
commit aee44a7bfc
@@ -424,11 +424,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);