• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

Stateless S Bean use

 
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Put the moon back where you found it! We need it for tides and poetry and stuff. Like this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic