There is lots of confusion about the idea of "stateless"
session beans.

Stateless beans are stateless in term of remembering
state between invocations from clients. This does
Not mean that they cannot have state that is not associated
with a client.

So a stateless bean can have open files, open RMI or
CORBA connections, whatever... Care should be taken
to manage these resources properly in the bean's life
cycle invocations (passivate/activte and such). If I recall,
stateless beans are never passivated though, so life
cycle isn't too hard (open stuff on ejbCreate, close stuff
on ejbRemove).

Note: if your stateless beans talk to non-EJB objects
such as RMI's or CORBA's, care must be taken with
regard to transaction semantics. If a bean side effects
the RMI/CORBA object, and that object doesn't support
transactions, it is most likely that the bean must be deployed
TX NOT SUPPORTED, or use bean managed transactions...

Most of the cases where I have used CORBA's with EJB,
the CORBA's are providing non-transactional services,
like event service, or PK generation utilities...

-Chris.

> -----Original Message-----
> From: Javier Borrajo [SMTP:[EMAIL PROTECTED]]
> Sent: Wednesday, May 12, 1999 12:35 PM
> To:   [EMAIL PROTECTED]
> Subject:      SessionContext with Objects not String properties
>
> Hi!
>
> We want to use stateless sessionbeans BUT they need to use
> some resources, for instance proxies to RMI servers
> or data read from a file.
>
> + Can we use javax.ejb.SessionContext to store String values
> as properties for each stateless session bean? I suppose the
> answer is affirmative but have not tried it yet, because what we really
> need is to be able to store objects, see next question...
>
> + How can I store something like an RMI connection proxy to an
> RMI server so that all my stateless session beans can use it?
>
> We don't want the session beans to be forced to create this connection for
> each client invocation of a business method. We want to create the
> connection
> once, store it in memory, and make it available to all stateless session
> beans,
> very much like a JDBC pool.
>
> Right now we store these objects in JNDI for the stateless session beans
> to
> use it, but we are not happy with this solution:
> - JNDI usually means accesing the properties from another JVM
>    so it is slower than storing the objects in memory
> - Some EJB servers allow us to store any object into JNDI, others
>    only let us store CORBA servers.
>
> Any ideas? Thanks a lot in advance.
>
>     Javier Borrajo
>     I+D Spain
>
> ==========================================================================
> =
> 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".

Reply via email to