• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

About the session tracking of stateful beans

 
Tang Yue
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Celinio Fernandes
Ranch Hand
Posts: 549
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well, in your example, sb is an instance of StatefulBean.

This is no session-tracking.
 
Tang Yue
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic