File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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: 2933

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...
I agree. Here's the link:
subject: STATELESS session bean...
It's not a secret anymore!