Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Concurrency / pooling with EJB

 
Raf Szczypiorski
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?
Thanks.
 
Reza Rahman
author
Ranch Hand
Posts: 580
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Raf,

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.

Regards,
Reza
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic