You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2022/12/05 11:36:00 UTC

[jira] [Commented] (OFBIZ-9385) EntityListIterator closed but not in case of exception

    [ https://issues.apache.org/jira/browse/OFBIZ-9385?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17643289#comment-17643289 ] 

ASF subversion and git services commented on OFBIZ-9385:
--------------------------------------------------------

Commit 35840f97026739e2167a09de7b1e64916f4bcadf in ofbiz-framework's branch refs/heads/release22.01 from Jacques Le Roux
[ https://gitbox.apache.org/repos/asf?p=ofbiz-framework.git;h=35840f9702 ]

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


> EntityListIterator closed but not in case of exception
> ------------------------------------------------------
>
>                 Key: OFBIZ-9385
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-9385
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: ALL COMPONENTS
>    Affects Versions: Trunk
>            Reporter: Jacques Le Roux
>            Assignee: Jacques Le Roux
>            Priority: Minor
>             Fix For: 17.12.01
>
>
> I found several cases. This is an improvement only because no cases were reported. But obviously in case of unlucky exception after the EntityListIterator creation and before it's closed the EntityListIterator remains in memory. It should be closed in EntityListIterator.finalize() but the less happens there the better.
> The solution is to use try-with-ressources when (easily) possible (some cases are quite convoluted)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)