File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Method call on session bean

 
Kanu Dialani
Greenhorn
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 108
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Mark Spritzler
ranger
Sheriff
Posts: 17276
6
IntelliJ IDE Mac Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic