Does Stateful Session bean support instance pooling?

Alessandro A. Garbagnati

According to Richard Monson Haefel's book (Enterprise Java Beans, O'Reilly), Stateful Session Bean conceptually doesn't have instance pooling. But some container implement pooling internally.
According to Ed Roman, it does support pooling.
Can anybody pls tell me what specification says ?

Personally, I think that Richard is right, even after taking another quick look at the specs and thinking a little bit about it.

Reading the specs, in fact, there is no clear indication that a Stateful Session Bean is or is not pooled, while for the Stateless Session bean there is a specific paragraph (7.9.4 "Adding instance to the pool") that discuss the sequence for adding/removing an instance to/from the pool.

To this, I would add some thoughts. The lifecycle of a Stateful Session Bean is strictly connected with "his" client. When the client decides to remove the bean, the bean has no reason to exists, because it cannot be used from another client without being (at least) reinitialized. Pooling it doesn't really make sense.
But, at the same time, I would accept that, maybe for gaining performance (or for other reasons), some containers do pool Stateful Session Beans just to avoid the overhead of recreating the object.
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact