Hello,

I am interested in sharing a specific instance of a stateful session bean
between multiple clients. Now I know that you aren't supposed to do this
and that entity beans are supposed to be used for shared data objects.
However, some of the shared data objects in this application don't need to
be persisted to durable storage and I'd like to avoid the overhead of all
the unnecessary database reads and writes. Now I could use non-bean classes
for these data objects, but the other enterprise bean features are
important (remote access, transactions, clustering/failover, etc).

We tried the following with WebLogic 5.1 and 6.0:
1. Client A goes through the usual process to look up and get a remote
reference to Bean A (the stateful session bean/shared data object).
2. Client A invokes some methods on Bean A via Reference AA (its remote
reference to Bean A) resulting in changes to the data held in Bean A.
3. Client A passes Reference AA to another class, Client B.
4a. Client B either attempts to use Reference AA to access Bean A and/or
4b. Client C requests Reference AA from Client B and then attempts to use
it to access Bean A.

What happens is that when Clients B or C try to access Bean A using
Reference AA, a new bean instance (Bean B) is created. I had expected that
having the remote reference to a specific bean would allow the other
clients to also access that same bean instance.

(As an aside, this actually only happens when the clients are in a
difference VM then the bean(s). If they are all in the same VM, it looks
like WebLogic cuts some corners and all the clients are able to access the
same bean).

So, I'm wondering if anyone has had similar experiences and can suggest a
solution, work-around or better way to do this.

Thanks,
Andrew

-------------------
Andrew Friedman
Director, Platform Development
Unplugged Games
http://www.ungames.com

===========================================================================
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