Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

isIdentical

 
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
 
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?
 
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.
 
If you are using a rototiller, you are doing it wrong. Even on this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic