• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

isIdentical

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
suppose if it is stateful session bean ?
 
Thomas Vezhambacheril
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
A day job? In an office? My worst nightmare! Comfort me tiny ad!
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic