wood burning stoves 2.0*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes STATELESS session bean... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "STATELESS session bean..." Watch "STATELESS session bean..." New topic

STATELESS session bean...

Senthil Gangatharan

Joined: Oct 14, 2005
Posts: 3
STATELESS session bean CAN have instance variables, but there is no guarantee, that these variables will be accessed by the same client. However, the instance variables of the instance can contain the state across client-invoked method calls.. Examples of such states include an open database connection and an object reference to an EJB object

---Does this mean that If I call more than one consecutive business method calls, then I will get the same Bean instance?
Peer Reynders

Joined: Aug 19, 2005
Posts: 2921

Your statement is almost exactly what it says on page 87 (7.8 Stateless session beans) of the EJB 2.0 specification - a little bit further it also states:

Because all instances of a stateless session bean are equivalent, the container can choose to delegate a client-invoked method to any available instance. This means, for example, that the Container may delegate the requests from the same client within the same transaction to different instances, and that the Container may interleave requests from multiple transactions to the same instance.
Senthil Gangatharan

Joined: Oct 14, 2005
Posts: 3
Peer Reynders,
Got it. Thank you...
wood burning stoves
subject: STATELESS session bean...
Similar Threads
Stateless session beans and Transactions
How the second client knows the bean is free?
Stateless session beans' scalibility
singleton stateless session bean
Question regarding Lifecycle of STATELESS session bean.