File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes Session Bean Re-entry 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 » Java » EJB and other Java EE Technologies
Bookmark "Session Bean Re-entry" Watch "Session Bean Re-entry" New topic

Session Bean Re-entry

Ravi Bansal
Ranch Hand

Joined: Aug 18, 2008
Posts: 84
EJB 3.x specs Section 4.3.14

The container serializes calls to each stateful and stateless session bean instance. Most containers will support many instances of a session bean executing concurrently; however, each instance sees only a serialized sequence of method calls. Therefore, a stateful or stateless session bean does not have to be coded as reentrant.

Does this mean , below should not work in any app-server (its applicable to stateful as well) ?
other question that is coming to my mind is that in this case , container will create/fetch another instance of MyService bean when save() is invoked. It may or may not be the same instance of MyService bean in when myMethod got invoked by client ? OR it behaves differently depending upon whether the bean is stateful or stateless ?

SCJP 5.0 94%
It is sorta covered in the JavaRanch Style Guide.
subject: Session Bean Re-entry
Similar Threads
Stateless session beans' scalibility
HFEJB p.561: Help needed to fill Exception Chart for Remote and Local Clients
Strange interview question
Stateless session beans and Transactions
Doubt in mock exam Qs from HFEJB