[jboss-jira] [JBoss JIRA] Created: (EJBTHREE-854) Nested SFSB that declares @Remote does not have a dependent lifecycle

Brian Stansberry (JIRA) jira-events at jboss.com
Mon Jan 29 13:53:06 EST 2007


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
            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

        



More information about the jboss-jira mailing list