File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes About the session tracking of stateful beans 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 "About the session tracking of stateful beans" Watch "About the session tracking of stateful beans" New topic
Author

About the session tracking of stateful beans

Tang Yue
Ranch Hand

Joined: Nov 11, 2008
Posts: 40
After reading EJB in action, I still wonder exactly how the EE container does session-tracking?

For example:

clientMethod() {
@EJB
StatefulBean sb;
sb.method1();
....
sb.method2();
}

How does the EE container ensure that the same stateful bean is served when method1 and method2 are called?

Is this implemented some lower-level protocol?


Houston Rockets go go go!
Celinio Fernandes
Ranch Hand

Joined: Jun 28, 2003
Posts: 548

well, in your example, sb is an instance of StatefulBean.

This is no session-tracking.


SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCBCD 5
Visit my blog
Tang Yue
Ranch Hand

Joined: Nov 11, 2008
Posts: 40
I know on the hgih abstraction level, developers would see a stateful bean always serving the same client. But how is this implemented by a container?

How does a container see two calls(method1, method2) from the same client and give it the same stateful bean?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: About the session tracking of stateful beans