File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Stateless S Bean use

 
Christopher Arthur
Ranch Hand
Posts: 149
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's just a simple question about these beans:
Suppose two clients want to use the same type of stateless session bean. They each have their EJBObjects and they both call a business methods through it at almost the same time.
Will the container pull two instances out of the pool so that they can each have their own bean, or will the client who gets there last just get an exception because the bean's in use?
 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The container will have a pool of session beans to handle requests from multiple clients. There isn't just one of them in the container to handle everything. That wouldn't be very good at all. At the very least, if the pool is empty, the container will just wait until one becomes available. The client won't be getting any sort of exceptions because of this.
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The container is multi-threaded, so can spawn a thread to pull a method-ready bean from the pool to service each client concurrently. You'd need to configure the container to create the bean instances. For instance, WebLogic allows you to have up to 1,000 beans in the pool by using the max-beans-in-free-pool element in the weblogic-ejb-jar.xml file.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic