[
http://jira.jboss.com/jira/browse/EJBTHREE-854?page=all ]
Brian Stansberry updated EJBTHREE-854:
--------------------------------------
Affects Version/s: EJB 3.0 RC9 - Patch 1
Carlo, I put your name on this and Fix Version of RC10 so you'd be sure to see it.
Who/when it gets fixed is of course your call. :)
Nested SFSB that declares @Remote does not have a dependent
lifecycle
---------------------------------------------------------------------
Key: EJBTHREE-854
URL:
http://jira.jboss.com/jira/browse/EJBTHREE-854
Project: EJB 3.0
Issue Type: Bug
Affects Versions: EJB 3.0 RC9 - Patch 1
Reporter: Brian Stansberry
Assigned To: Carlo de Wolf
Fix For: EJB 3.0 RC10 - FD
Per forum thread:
Bill Burke wrote:
Nested SFSBs have to share the same lifecycle as their parents. They also have to share
the same Extended Persistence Contexts the reference!
Brian Stansberry wrote:
This is broken if the nested SFSB declares @Remote. This test fails:
Code:
ParentStatefulRemote stateful = (ParentStatefulRemote)
ctx.lookup("testParentStateful/remote");
assertEquals("Counter: ", 1, stateful.increment());
NestedStateful nested = stateful.getNested();
stateful.remove();
// Confirm nested no longer works following parent remove
try
{
nested.increment();
fail("Nested bean still exists following destruction of parent");
}
catch (Exception good)
{
// this is what we want -- nested has no independent lifecycle
}
I've been digging around trying to understand what's going on. For some reason,
if the nested bean declares @Remote, when a StatefulCache calls Pool.get(), it gets back a
standard StatefulBeanContext rather ProxiedStatefulBeanContext. This has to be a function
of how calls are nested (i.e. the nested bean gets created *before* the parent, thus the
parent hasn't been pushed onto the ThreadLocalStack when the nested bean is created.)
Test that fails is
org.jboss.ejb3.test.stateful.unit.NestedBeanUnitTestCase.testDependentLifecycle().
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira