For stateless beans, the bean-client association happens only during a business method invocation. When an isIdentical() operation is performed, although the client can assume that it is comparing two EJBObject instances, the actual implementation (which is vendor independent) would just result in a comparison of their respective EJBHome-s.

Regards<br />Ram<br /> <br />SCJP 1.4, SCBCD 1.3, (SCEA)

Shanmugam Karthikeyan

Ranch Hand

Posts: 58

posted 12 years ago

Hi,

Thanks for your reply.

Did you mean to say that for a stateless session bean, The isIdentical method compared the Home Object rather than the EJBObject since the EJBObject is create only when a client invokes the business method ?

So in this case it will always return true because a single Home Object will be created and shared no matter how many EJBObject or session bean instances are created.

SCJP 1.4<br />SCWCD 1.4<br />SCBCD 1.3

Ramakrishnan Viswanathan

Ranch Hand

Posts: 90

posted 12 years ago

It is the container's discretion whether to create one or two EJBObject(s). And each container may do this differently, so this is purely a vendor implementation. There is no guarantee that you have 2 instances created from the same home. What is guaranteed is that calling isIdentical() would return true no matter how the container handles the creation. So you wouldn't really have to know whether the server created two different objects or is just using one.

Regards<br />Ram<br /> <br />SCJP 1.4, SCBCD 1.3, (SCEA)

All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad: