Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Query on 'isIndentical()' method

 
AC AC
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
 
Ganesh Krishnan
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.
 
Muhammad Saeed
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.
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • 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