Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

isIdentical

 
Thomas Vezhambacheril
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Question :- A client has two object references to a session bean's home interface. How can it find out whether the object references are accessing the same object?

I think answer will be

Using the isIdentical() method

But the given answer is References of the home interface of the same bean are always identical because there is only one instance of the Home interface. Means there is no need of isIdentical() method.

But as per my observation this will be right only if session bean is stateless isn't ?

Please share ur opinion
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is your reason for believing that there will be multiple home objects for session beans which are not stateless?
 
Thomas Vezhambacheril
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
suppose if it is stateful session bean ?
 
Thomas Vezhambacheril
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
means stateful session beans reference returned from same home will be different while we are using isIdentical(). isn't?
 
Ed Marte
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Thomas Vezhambacheril:
Question :- A client has two object references to a session bean's home interface.
But the given answer is References of the home interface of the same bean are always identical because there is only one instance of the Home interface. Means there is no need of isIdentical() method.


You cannot call isIdentical method on home interface, because there's no such method in EJBHome interface, it's in EJBObject only.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic