This week's book giveaway is in the OCP forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 11 Developer Practice Tests and have Scott Selikoff and Jeanne Boyarsky on-line!
See this thread for details.
Win a copy of OCP Oracle Certified Professional Java SE 11 Developer Practice Tests this week in the OCP 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
Sheriffs:
  • Devaka Cooray
  • paul wheaton
  • Mark Herschberg
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
  • Jj Roberts
Bartenders:
  • Carey Brown
  • salvin francis
  • Piet Souris

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
 
Everybody! Do the Funky Monkey! Like this tiny ad!
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic