You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2022/12/05 11:35:33 UTC

[ofbiz-framework] 02/02: Fixed: EntityListIterator closed but not in case of exception (OFBIZ-9385)

This is an automated email from the ASF dual-hosted git repository.

jleroux pushed a commit to branch release22.01
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git

commit 35840f97026739e2167a09de7b1e64916f4bcadf
Author: Jacques Le Roux <ja...@les7arts.com>
AuthorDate: Mon Dec 5 11:17:04 2022 +0100

    Fixed: EntityListIterator closed but not in case of exception (OFBIZ-9385)
    
    Following discussion
    https://lists.apache.org/thread/37vo721s7d5no0k73ym4959m8wtgtl95
    reverts "This fixes a bug introduced with r1797097"
    commit d9a24d5a347e28f241e73af9c4d9ea4bb55aeb16.
    Conflicts handled by hand in ListFinder.java
    
    Also as suggested by Deepak Dixit removes explicit eli.close call from
    handleOutput(), else we will get unnecessary console warning from
    EntityListIterator.close() method:
      Debug.logWarning("This EntityListIterator for Entity [" +
      modelEntityName + "] has already been closed, not closing again.",
      module);
    
    Thanks: Deepak Dixit for spotting the issue and discussion
---
 .../src/main/java/org/apache/ofbiz/entity/finder/ListFinder.java       | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/finder/ListFinder.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/finder/ListFinder.java
index cdac10b318..c9ea06705d 100644
--- a/framework/entity/src/main/java/org/apache/ofbiz/entity/finder/ListFinder.java
+++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/finder/ListFinder.java
@@ -215,7 +215,8 @@ public abstract class ListFinder extends Finder {
                     options.setMaxRows(size * (index + 1));
                 }
                 boolean beganTransaction = false;
-                try (EntityListIterator eli = delegator.find(entityName, whereEntityCondition, havingEntityCondition, fieldsToSelect, orderByFields, options)) {
+                try (EntityListIterator eli = delegator.find(entityName, whereEntityCondition, havingEntityCondition, fieldsToSelect, orderByFields,
+                        options)) {
                     if (useTransaction) {
                         beganTransaction = TransactionUtil.begin();
                     }