EntityBean instances are leaked from pool if exception is thrown
during instance activation
-------------------------------------------------------------------------------------------
Key: WFLY-4638
URL:
https://issues.jboss.org/browse/WFLY-4638
Project: WildFly
Issue Type: Bug
Components: EJB
Affects Versions: 9.0.0.CR2, 10.0.0.Alpha1
Reporter: Alexey Makhmutov
Assignee: Alexey Makhmutov
Fix For: 10.0.0.Alpha2
This is addition to WFLY-4569.
One more case was discovered when bean is leaked from the pool after an exception is
thrown in certain methods:
* If any exception is thrown during call to instance.activate() (which includes calls to
ejbActivate and ejbLoad), then cache implementations (both optimistic and pessimistic)
never notifies pool that instance should be discarded.
In addition, a little correction should be made for handling exceptions thrown from
ejbCreate (handling was introduced as part of WFLY-4569) -- such instances should not be
released to the pool, but discarded with pool notification in order to comply with EJB
specification.