Win a copy of Cloud Native PatternsE this week in the Cloud forum
or Natural Language Processing in the AI/ML 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
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Query on 'isIndentical()' method

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

From Paul SCBCD, chapter three, method 'isIndentical()' in remote component interface checks whether two EJB Ojects are identical or not. In case, there are multiple accesses to the same EJBHome, multiple EJBObjects and bean instances will be created to serve each access individually. Thus, the EJBOjbects will be difference and the 'isIndentical()' method will return false. However, the book said that for stateless session bean, 'isIndentical()' always return true. Please advise.

Rgd
Akchng
 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi AC,

To put things simply, the Stateless session bean is not client specific, and the EJBObjects generated by the same home would evaluate to true... thus for all stateless session beans the isIdentical() method will return true...

- Ganesh.
SCJP,SCBCD,SCEA,BEA Certified Weblogic Administrator.
 
AC AC
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ganesh,

For stateful session beans, there are also only one EJBHome for multiple accesses from clients. In case, all clients use the create() method in the EJBHome, there is not client specific also. In this case, can we say that all stateful session beans the isIndentical() method return true???
Please correct if I am wrong.

Rgds
AC
 
Ganesh Krishnan
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi AC,

Please remember that for each stateful session object, the container assigns a unique identity, since they are specific to each client.

Thus in the case of statful SB, the isidentical() method will always evaluate to false for diff. ejb objects, though both of them are from the same home...

hope this clarifies your question.

- Ganesh.
SCJP,SCBCD,SCEA,BEA Certified Weblogic Administrator.
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HeadFirst, Page 141 discusses the issue in detail.

True, for Stateless session beans if both references came from the
same home, even if the stubs are referring to two different Remote
EJB objects.

False, for Stateful session beans, for any two unique stubs even from
the same home.

Hope it helps.
 
Author & Gold Digger
Posts: 7610
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
AC AC,

We hope you are enjoying your stay here at Javaranch. We'd like you to modify your display name in order to comply with our naming policy.

We thank you for your comprehension
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!