You can invoke on a single session bean reference as many times as you want
(remember it is only a stub from the client). The fact that this server may
rotate different SB server instances on the back end is transparent.
If an EJB server requires you to do such gymnastics it is out of spec and
horribly constraining!
-Chris.
> -----Original Message-----
> From: Laird Nelson [SMTP:[EMAIL PROTECTED]]
> Sent: Wednesday, January 12, 2000 9:00 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Stateless Session Beans
>
> Assaf Arkin wrote:
> >
> > Assume that a stateless bean only exists for the duration of a method
> > call. After you're done with it, the bean is disposed of (or reused by
> > someone else). Before calling a bean, always look it up through JNDI.
>
> I think I understood this before, but its impact is just becoming clear
> to me. Is it REALLY true that I *shouldn't* do something like this:
>
> // look up session bean here via JNDI...
> sessionBean.foo();
> sessionBean.bar();
> sessionBean.baz();
>
> ...but SHOULD instead do something like this:
>
> InitialContext ctx = getTheContext(); // can't remember syntax off top
> of head
> SomeSessionBean bean = (SomeSessionBean)ctx.lookup(name);
> bean.foo();
>
> bean = (SomeSessionBean)ctx.lookup(name);
> bean.bar();
>
> bean = (SomeSessionBean)ctx.lookup(name);
> bean.baz();
>
> ...? Wow. And this is all supposed to scale?!
>
> Cheers,
> Laird
>
> ==========================================================================
> =
> 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".