aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Method call on session bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Method call on session bean" Watch "Method call on session bean" New topic
Author

Method call on session bean

Kanu Dialani
Greenhorn

Joined: Apr 30, 2005
Posts: 23
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.

Please help...
Chris Brat
Ranch Hand

Joined: May 22, 2003
Posts: 108
Hi,

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.

Chris


SCJP 1.2, SCJP 5, SCBCD
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

"Kanu"

Please click on the My Profile link above and change your display name to meet the JavaRanch Naming Policy of using your real first and real last names.

Thanks

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Method call on session bean