• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Concurrency / pooling with EJB

Ranch Hand
Posts: 383
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. I have a question about concurrent access of many clients. Suppose I have a stateless session bean, which is pooled, and the pool has at most 10 instances. Does this mean 10 clients can be served simultaneously (1 for each bean, the 11th client waits) or can many many more client be served (because each of the pooled beans can be accessed by many threads of control)? The same would relate to MDBs.
With stateful session beans, if I have a million clients connected, and the memory and hardware would allow this, would I have a million ejb instances? What if the server runs out of memory? Does it throw an exception then?
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Here are some pointers:

1. The number of concurrent stateless session beans are limited by the upper bound for the pool. If you don't think you need bandwidth control, you can set the pool size to increase indefinitely (not all app servers support this since it is really not advisable from an application SLA standpoint).
2. Once memory is low enough, most application servers will start serializing stateful session beans to the disk. This works as long as the high number of stateful clients are not "truly" concurrent. This is one of the reasons I worry about things like Seam that encourage the stateful model more than is necessary.

Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic