As far as i know, there is no other way than defining a real entity bean to
store something. One could think to use static variables within a stateless
session bean, but this approach fails if it comes to clustered servers with
multiple JVMs (and nobody can guarantee anything about the lifetime of a
static variable, when the bean is no longer in use in a single JVM model,
too). The spec does not define some sort of "stateful server bean" to store
temporary information within server lifetime, so you have to simulate it by
an entity bean (which means, to ensure transaction safe behaviour and so on
you'll need a database...). BTW, this is not very orion specific ;-).

Jens Stutte

-----Ursprüngliche Nachricht-----
Von: Pedro Garcia Lopez [mailto:[EMAIL PROTECTED]]
Gesendet am: Donnerstag, 25. Mai 2000 13:01
An: Orion-Interest
Betreff: EJB state question

Hi all,

How can I maintain non-persistent state in a component that will be
accesed by multiple clients ?

For example, I have a component that subscribes to a JMS topic and
listen for events.
I created a Stateless Session Bean with a getLastMesssage() methof that
returns the last message obtained from the topic.
But, due to the stateless nature of the session bean, it always returns
the default value.
If it is statful is only valid for a client, so ...

Is it possible in the EJB model to create a component that maintain
state and it is accesed for several users ?

In the Web model (WAR) you can use a bean with application scope, but,
how can I do it with EJBs ?

Regards,


Reply via email to