Kartik Sirigeri created TOMEE-4560:
--------------------------------------
Summary: Memory leak for EJB2 stateful bean
Key: TOMEE-4560
URL: https://issues.apache.org/jira/browse/TOMEE-4560
Project: TomEE
Issue Type: Bug
Components: TomEE Core Server
Affects Versions: 8.0.16
Reporter: Kartik Sirigeri
Attachments: EjbProxyHandler_EJB2.png, EjbProxyHandler_EJB3.png,
test_project.zip
The bean references are not getting removed from
ProxyRegistry.liveHandleRegistry map when the the method annotated wtih
'@Remove' annotation for EJB3 stateful bean is invoked. While the call for
remove method on EJB2 stateful beans removes the entry from
ProxyRegistry.liveHandleRegistry map immmediately. It seems the
EjbObjectProxyHandler._invoke method checks for EJB_OBJECT, EJB_LOCAL type
along with the operation type, this check fails for EJB3 beans and the beans
remove in the ProxyRegistry.liveHandleRegistry map unless any further business
methods are invoked which would invaldiate the map due to
InvalidateReferenceException. This causes a memory leak unless any business
method is not called after the invocation of @Remove method in EJB3.
Snapshot of the debug flow attached along with the test code
--
This message was sent by Atlassian Jira
(v8.20.10#820010)