• 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
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

Stateless beans - isIdentical()

 
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

For stateless beans calling the isIdentical() method on the ejb objects from the same home returns true, fine.
If the bean is deployed twice two homes will be created(say Home1 and Home2 ) and now i got the two ejb objects one from each of the home ( Home1 and Home2), now if i call the isIdentical() method on these ejb objects - i will get false. Is it true ?
One of my doubt is, What is meant by deploying the same bean twice?
Another question is take the below code, ( for local client)

Context ctx = new InitialContext();

AccountHome home1 = (AccountHome)ctx.lookup("java:comp/env/AccountRef");
Account acct1 = home1.create();

AccountHome home2 = (AccountHome)ctx.lookup("java:comp/env/AccountRef");
Account acct2 = home2.create();

Now --> acct1.isIdentical(acct2) -- Will return true or false.


Thanks in Advance,
 
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If the JNDI name is the same, then you are NOT deploying the bean twice, but redeploying the same bean. The container will create only one home object. acct1.isIdentical(acct2) will then return true.
 
Narasimha Rao B.
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Keerthi.
 
My name is Inigo Montoya, you killed my father, prepare to read a tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic