• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

isIdentical understanding

 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Because stateless session beans have the same object identity, the isIdentical method always returns true when used to compare them.

I am not able to understand what does same object identity means ?

Please help
 
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For stateless bean, we know all the session bean instances are same which are created in a containere. That is the reason isIdentical() method returns always returns true.

Regards
Kasimurugan R
 
Chetan Sahasrabudhe
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kasimurugan

Thanks for the information.
I guess stateless sesson bean idealy should not have any class attributes.
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear friends,

On page 141 of the Head First EJB book the author says

the isIdentical() method return TRUE for

stateless beans when they are create from the same HOME,

if you make a new deploy and get another home, the isIdentical

will return false, if compared with the beans created from

the older Home.

The example on the specification use the same home object,

but did not say anything about this.

We can research.... :-)
 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
i have tested this...

i created one SLSB and deployed twice with 2 difrent jndi names.Then i created 3 home objects. 2 with from same jndi context and 1 from 2nd jndi context. then i compard(using isIdentical) the ejbObjs from the 1st two.it returnd me true (and it shud). then i campard 1st and 3rd ejbObj(both r deplod with 2 difrent jndi context but of same type). it also returned me true!!!

i also red frm the HFEJB that if u deployed twice , it wil return false.....

something quizzzy....

binoj
 
Binoj Viswanathan
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
also in spec, it says, the container will keep same obj identity for all bean instances from same home type.(P66)
so isIdentical() shud return true even if it deployed twice and using from ejbObj from each one.

binoj
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic