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

Daniel Watford commented on OFBIZ-9385:
---------------------------------------

Hi [~jleroux] , I ran into an issue with EntityListIterator when navigating the 
Chart Of Accounts - please see 
[https://demo-next.ofbiz.apache.org/accounting/control/GlAccountNavigate?glAccountId=100000.]

The logs show:
{quote}{{2022-12-06 17:22:48,198 |sse-nio-8443-exec-12 |EntityListIterator      
      |W| This EntityListIterator for Entity [GlAccount] has already been 
closed, not closing again.}}
{{2022-12-06 17:22:48,199 |sse-nio-8443-exec-12 |ControlServlet                
|E| Error in request handler:}}
{{org.apache.ofbiz.base.util.GeneralRuntimeException: Error getting the next 
result (ResultSet not open. Operation 'next' not permitted. Verify that 
autocommit is off.)}}
{{        at 
org.apache.ofbiz.entity.util.EntityListIterator.next(EntityListIterator.java:332)
 ~[main/:?]}}
{{        at 
org.apache.ofbiz.widget.model.ModelTree$ModelNode.getChildren(ModelTree.java:465)
 ~[main/:?]}}
{{        at 
org.apache.ofbiz.widget.model.ModelTree$ModelNode.hasChildren(ModelTree.java:561)
 ~[main/:?]}}
{{        at 
org.apache.ofbiz.widget.renderer.macro.MacroTreeRenderer.renderNodeBegin(MacroTreeRenderer.java:152)
 ~[main/:?]}}
{{        at 
org.apache.ofbiz.widget.model.ModelTree$ModelNode.renderNodeString(ModelTree.java:686)
 ~[main/:?]}}
{{        at 
org.apache.ofbiz.widget.model.ModelTree.renderTreeString(ModelTree.java:291) 
~[main/:?]}}
{quote}
I haven't debugged the issue yet - I just wanted to check in with you in case 
you recognised it as related to OFBIZ-9385.

> 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, 22.01.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)

Reply via email to