Closed baldimir closed 6 months ago
That's ok, but I wonder if it makes sense to make the
KieSession
to also implementAutocloseable
and maybe implement theclose()
method just like an alias for thedispose()
one. I did something similar for the RuleUnitInstance and this allows you to use try-with-resource like this. WDYT?
Yes, that sounds fine. However I think it would be better done in a separate PR. I will take a look.
Here is another PR with the AutoCloseable functionality https://github.com/apache/incubator-kie-drools/pull/5890.
Jenkins PR check failed on kogito-examples on some Jenkins environment issue. It is unrelated to these changes. So I think this can be merged.
Fixes: https://github.com/apache/incubator-kie-issues/issues/1153
Kie Session needs to be disposed in tests to avoid memory leaks.