Suppose client A invokes a method on a stateless session bean. While waiting for the method to complete, client A passes the component interface to client B. Client B invokes a method on the given component interface while client A is still waiting for the method to be complete. Client B will get an exception.
Inside some code say a swing application.
...
...
AComponentInterface aComponentInterface=...
aComponentInterface.method();
...
...
When you say pass aComponentInterface to another client do you mean it gets used by another seperate application? What do you mean by another client? As long as the aComponentInterface is passed to other code running in same JVM and thread would it not be same application?
If clientB is a seperate application in another JVM I dont know how you passed it there.
If clientB is same application in same thread then my understanding is the calls are all processed sequentially and not asynchronously.
So the only option left out it appears is a seperate thread uses same stub and invokes the method.
I am assuming you are wrong about the following
If the component interface type (or stub) is shared by the multiple threads of a client application we might get this exception I guess -
Each client will get its own component interface (not sharable), but there is only one home interface.
(Lets say you share it as a static field why is it not sharable? Unless it is sharable how will you ever get that exception?)
I am assuming you are right about the following
Would a multithreaded client application be considered as one client or multiple clients? If the component interface type (or stub) is shared by the multiple threads of a client application we might get this exception I guess -
It will considered to be multiple clients although they may have the same pricipal.
Another thing-
With stateless it might happen if the conatiner cannot convert concurrent calls into sequential pocessing by the bean when there is only say 1 bean in the pool and there is no provision to increase the bean size or make new beans
The container must enforce this policy;therefore, I don't think this scenerio will occur.
Read page 238n of HFEJB. It says as per the specs the container is free to do this but I suppose that is non-guaranteed behaviour.
[ August 23, 2004: Message edited by: Swamy Nathan ]