Hi,

After fixing a bug in my test case I can see that this is now indeed 
fixed.

However, I'm going to be a pain here. I don't think that your test case 
code in

org.jboss.test.JBossTestCase.testLocalInterfacePassivation
        and
org.jboss.test.cts.ejb.StatefulSessionBean

proves anything. It only proves that at some point one or both of 
ejbPassivate/ejbActivate have been called. Before the bug was fixed, the 
failure was occurring after ejbPassivate was called.

In order to properly test that the StatefulSessionBean was passivated 
and then recreated you need a transient flag that gets set in 
ejbPassivate. Your non-transient 'wasPassivated' flag will itself be 
serialised and then reinstated at activation time, but for good measure, 
you set it again in ejbActivate anyway. Consequently, you can't tell if 
the bean was ever successfully passivated and then reactivated. The only 
way to tell is by exploiting the fact that transient members aren't 
reinstated when the bean is reactivated.

Therefore, I think that:

1. org.jboss.test.cts.ejb.StatefulSessionBean.wasPassivated should be 
transient (and probably renamed - that's why it's just called 
'passivationFlag' in my test case).

2. the line containing 'wasPassivated = true;' should be removed from 
ejbActivate().

For a slightly stronger test, leave the 'wasPassivated' flag as is, and 
add a second transient field so that you can check that passivation was 
actually attempted and it succeeded (because the transient field gets 
reset).

Steve Coy

On Friday, April 19, 2002, at 02:58  AM, [EMAIL PROTECTED] wrote:

> Bugs item #541855, was opened at 2002-04-09 22:21
> You can respond by visiting:
> http://sourceforge.net/tracker/?func=detail&atid=376685&aid=541855&group_id=
> 22866
>
> Category: JBossServer
> Group: v3.0 Rabbit Hole
>> Status: Closed
>> Resolution: Fixed
> Priority: 6
> Submitted By: Stephen Coy (scoy)
> Assigned to: Scott M Stark (starksm)
> Summary: Passivation of stateful sess beans fails
>
> Initial Comment:
> Section 7.4.1 of the EJB2.0 spec says that
> EJBLocalHome and EJBLocalObject (amongst
> others) should be persisted during passivation.
> The code in
> org.jboss.ejb.plugins.SessionObjectOutputStream
> clearly doesn't do this yet.
>
> Someone needs to check and ifx this code for
> EJB2.0 conformance.
>
>
> ----------------------------------------------------------------------
>
>> Comment By: Scott M Stark (starksm)
> Date: 2002-04-18 09:58
>
> Message:
> Logged In: YES
> user_id=175228
>
> Fixed on head and the 3.0 branch
>
> ----------------------------------------------------------------------
>
> Comment By: Stephen Coy (scoy)
> Date: 2002-04-17 01:10
>
> Message:
> Logged In: YES
> user_id=463096
>
> Doh! I figured out that I can set the cache size to 1.
> Creating  a second session bean causes the first to be
> passivated. We now have a test that successfully fails.
>
> ----------------------------------------------------------------------
>
> Comment By: Stephen Coy (scoy)
> Date: 2002-04-17 00:17
>
> Message:
> Logged In: YES
> user_id=463096
>
> The attached files incorporate test case "stateful2" into
> the JBoss test suite. Please remove any .DS_Store
> files you find - they're an unfortunate side effect of using
> MacOS at present.
>
> I spent quite some time trrying to configure the
> container so that the session bean would passivate
> before the test completed, but failed miserably.
> However, you can still see the passivation failing when
> the EJB is undeployed.
>
>
> ----------------------------------------------------------------------
>
> You can respond by visiting:
> http://sourceforge.net/tracker/?func=detail&atid=376685&aid=541855&group_id=
> 22866
>
> _______________________________________________
> Jboss-development mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-development


_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to