Hi, I am calling a session bean from a MDB. The MDB gets a component Object stub and calls two methods on the same stub. I just wanted to know whether both the calls will go to a single session bean or it may happen that the first method is called on 1 session bean and the other method is called on another session bean as there is a pool of session beans.
If this is a poor design, should i combine the methods in session bean and call a single method from my MDB.
The answer depends on whether you are using a stateless session bean or a statefull one.
If Statefull then yes the two methods will be called on the same bean. If Stateless then it cannot be guaranteed that the same bean will be used for both method calls - the container manages the beans and it may give the client the same bean or a differenct one.