• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Session Bean Identity

 
khaled Jamal
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I read that All business object references of the same interface type for the same stateless session bean have the same object identity, which is assigned by the container

I didn't get clearly what does it mean identity here ? does it affect thread safety of the stateless session bean or what ?

 
Ralph Jaus
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It means, that, if you compare two references for a business interface of a stateless session bean, equals() always returns true (in contrast to business interfaces of stateful session beans) - see core spec 3.4.5:

// Assume Test is a business interface of a SLSB
@EJB Test t1;
@EJB Test t2;
...
t1.equals(t2); // -> returns true

This reflects the fact that for a stateless session bean it doesn't matter which bean instance is used to process a business method invocation.
 
khaled Jamal
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ralph, I got it

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic