Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General 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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

About EJBObject.isIdentical()...

Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The EJBObject.isIdentical(Object o) returns true if two EJBObject stubs refer to the same bean's entity.

My doubt is...In the real world, when would you use this method?
Author & Gold Digger
Posts: 7617
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You would use this method whenever you need to assess whether two references to an entity bean refer to the same entity bean or not.

As the behavior of the equals and hashCode methods is not guaranteed in a distributed environment, you need the isIdentical method for performing the same kind of job you would do with the equals method in a normal Java program. You can also check out the primary key of the entity bean and base your decision on that.
    Bookmark Topic Watch Topic
  • New Topic