This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 547

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?
 
Consider Paul's rocket mass heater.
 
subject: About the session tracking of stateful beans
 
Similar Threads
Stateful session beans - how are sessions handled?
State of Stateful Session Beans
Protocol - Statefull session bean
Global variables in SessionBeans?
Invoking Nonexistent Stateful Session Bean