EJB Home And Select

Vishnu Munnangi

Ranch Hand

Posts: 114

posted 11 years ago

Hi Everyone,

Please go through the following question from one of the mock exams.

Q) A typical use of ejbHome and ejbSelect method would be? Select 2 Answers A. use ejbSelect methods within ejbHome methods to return entities B. use ejbSelect methods to access fields of a bean instance C. use ejbHome methods to perform operation not specific to a entity instance D. Use ejbHome methods to initialize entity bean instance variables

The Ans: given are B and C

I feel that A, C are correct.

Can any one please explain why option B is correct? Thanks in Advance.

Keerthi P

Ranch Hand

Posts: 203

posted 11 years ago

B. use ejbSelect methods to access fields of a bean instance

Looking at the option, it is not clear if it is referring to cmp fields or static final fields. Anyway, ejbSelect method can still access cmp fields, when called from business methods that are defined in component interface.

Cheers.<br />Keerthi<br />(SCJP, SCWCD, SCBCD)

Vishnu Munnangi

Ranch Hand

Posts: 114

posted 11 years ago

Thanks keerthi for the reply,

But I feel that option A is also correct A. use ejbSelect methods within ejbHome methods to return entities We can use ejbSelect methods within ejbHome methods right.

Correct me if I am wrong.

Thanks

Keerthi P

Ranch Hand

Posts: 203

posted 11 years ago

Yes. You are right.

Cheers.<br />Keerthi<br />(SCJP, SCWCD, SCBCD)

Will St Hubert

Greenhorn

Posts: 6

posted 11 years ago

Actually I have use ejbSelect<method> within an ejbHome<method> I think this is not clear.