Hi Kris,

> The problem I encountered was that a specific StateFul session
> bean had to be called from more than one other bean/application.

The EJB Spec definitely does not allow access from more than one
application to a stateful session bean instance:

| EJB spec 1.1
|
| Chapter 6  Session Bean Component Contract
|
| 6.11.6 Non-reentrant instances
|
| The container must ensure that only one thread can be executing
| an instance at any time. If a client request arrives for an
| instance while the instance is executing another request,
| the container must throw the java.rmi.RemoteException to the
| second request.
|
| Note that a session object is intended to support only a single
| client. Therefore, it would be an application error if two clients
| attempted to invoke the same session object.
|
| One implication of this rule is that an application cannot make
| loopback calls to a session bean instance.

This also explains, why there is no lookup() for a specific
stateful session bean instance. Though you could try to pass
a reference or a handle to the instance around, be aware of
the quoted implication (no loopbacks).

You didn't explain, why your stateless session instance wants
to access the statefull one. If it is not interested in client
specific state kept in the stateful instance, but needs some
service, consider extracting the service methods into a normal
class (i.e. a Singleton) or a stateless session bean and use
the service from both beans.

If it is the clients state, you are interested in, you must
redesign, so that the statfull instance is the 'driving' part
and reaches in the neccessary state as parameters.

regards

Georg
 ___   ___
| + | |__    Georg Rehfeld      Woltmanstr. 12     20097 Hamburg
|_|_\ |___   [EMAIL PROTECTED]           +49 (40) 23 53 27 10



_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to