Which of the following statements are true regarding the identity of two EJBs?

Submitted by: Administrator
a. Two stateful session beans are identical if their data attributes are identical.
b. Two stateful session beans are identical if their session contexts are equal.
c. Two stateless session beans are identical if they are of the same type.
d. Two stateless session beans are identical if their session contexts are equal.
e. Two entity beans are identical if they have same primary key but different home interface.
f. Two entity beans are identical if they have different primary key but same home interface.


B and C are correct. Since the stateful session beans maintain the conversational state of the clients, they are identical when their session contexts are equal. Two stateful session beans may have identical data attributes, but if the session contexts are different they are not identical. Thus choice A is incorrect and B is correct. Since stateless beans do not retain the conversational state, they are considered identical if they are of the same type. Thus choice C is correct.
If two entity objects have the same home interface and primary key, they are considered identical. The EJB specification does not mention object equality based on the = = operator. Also, if you compare two object references using the Java API, Object.equals(Object obj), the result is unspecified. The only way to compare object equality is through the isIdentical (EJBObject) API. Thus choice E and F are incorrect.
Submitted by: Administrator

Read Online BEA Weblogic Job Interview Questions And Answers