I think you may be approaching the problem in the wrong way. Stateful and
stateless session beans are used to house the usecases / business processes
of your application. Usecases that require knowledge of client state should
be implemented as methods on a stateful session bean. Usecases that don't
require knowledge of client state should be methods on a stateless session
bean.
If you want to pass a reference to your stateful bean around to stateless
beans then you are making the mistake of treating your session bean as just
a state holder, like a servlet session. A session bean should contain state
and all usecases that require that state. This is the most straight forward
way to do it. The methods on that stateful session bean can then access
methods on stateless session beans or entity beans and pass them whatever
information they may need.
Floyd Marinescu
---------------------------------
Senior Architect
The Middleware Company
http://www.middleware-company.com
[EMAIL PROTECTED]
416-889-6115
Need help with EJB / J2EE? Ask about our on-site training and consulting
services.
-----Original Message-----
From: A mailing list for Enterprise JavaBeans development
[mailto:[EMAIL PROTECTED]]On Behalf Of Amanda Sinton
Sent: Friday, May 05, 2000 3:43 AM
To: [EMAIL PROTECTED]
Subject: Environment propagation?
There may be a better way of doing what I need to do here, so somebody
please enlighten me! In my application client, I hold a Handle to a
stateful session bean. This contains all sorts of information specific
to that client (their name, currently chosen currency, that sort of
thing). Now, this information needs to be accessed by most of the
(stateless) session beans, and all of the entity beans (in order to set
some required database information). Now, the question is: how do I pass
that Handle (or indeed, any other object) around from the client to the
app server so that everything can get at it? Please don't tell me I have
to add it as a parameter to _every_ call!
Thanks for any help/pointers....
Amanda Sinton
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".