Hi Philippe, Calvin,
thanx for a fast response!
> In order to get a reference to a home object you must perform
> a JNDI lookup
> SubjectHome subjectHome =
> (SubjectHome)initialContext.lookup(homename);
> and not
> > (SubjectHome)HomeInterfaceFactory.create(
> > SubjectHome.class, SubjectHome.COMP_NAME);
I have written a helper class "HomeInterfaceFactory" that
does the same thing as what you said. This is not the problem.
Calvin said:
> I too have observed this behaviour, any local fields that haven't been
> declared as cmp-fields are not initialised.
> I assume this is part of the performance improvements made by the jonas
> team, bean instances are reused rather than created each time, hence your
> "subject" may already be pointing to some other EnrollmentBean's subject and
> your "if (subject != null)" returns true.
> To overcome this problem you could initialise all local fields in ejbLoad(),
> e.g.
> public void ejbLoad() {
> subject = null;
> }
You are absolutely right. I tried this and it works again.
I also saw this lazy load technique from Richard
Monson-Haefel. I also found in his book, that
this initialization should be done at ejbActivate().
The question is, if I always have to initialize
the local fields in ejbLoad() does it make any sense to
use this lazy load technique? When do I get (subject != null)?
Or how often do I get (subject != null)? I would like to
know how this works in Jonas...
Please answer directly to my email: [EMAIL PROTECTED]
Thanx,
--
---------------------------------------------------
Blasius Lofi Dewanto
---------------------------------------------------
OpenUSS - Open University Support System
http://openuss.sourceforge.net
---------------------------------------------------
E-Mail : [EMAIL PROTECTED]
ICQ : 39343280
---------------------------------------------------
----
To unsubscribe, send email to [EMAIL PROTECTED] and
include in the body of the message "unsubscribe jonas-users".
For general help, send email to [EMAIL PROTECTED] and
include in the body of the message "help".