There are some problems with the answers. Please comment
17. In CMP Entity Beans, which of the following statements is true?
a. The Primary Key Class should not define any constructors
b. The primary key class must define a no-argument constructor
You have supplied answer (a)
As per EJB by Richard Monson-Haefel Pg 158 “The no-argument constructor is required for container-managed persistence”. So the answer (b) is correct option.
22. In EJB, What type of exception is thrown when a system error occurs ?
a. EJBException
b. RemoteException
c. Exception
d. BeanException
You have supplied answer (a)
As per EJB by Richard Monson-Haefel Pg 312 “System exception are RuntimeExceptions, RemoteExceptions, and their subtypes. The EJBException is a subclass of the RuntimeException, so it is considered a system exception"
So option (b) is also right. Since Exception class is the base class for all types of exceptions it may also be included in the right options. Please comment.
24. Is ejbPassivate() invoked by the container when ejbRemove() is invoked?
a. True
b. false
No Answer is supplied. It should be (b) because in ejb specification there is no mention of calling ejbPassivation() when ejbRemove() is called. If you see output in Mastering EJB by Ed Roman pg 128 there is no call of ejbPassivation() before ejbRemove().
27. In EJBs, Which two callback methods can be used for synchronizing the bean's state with the database
a. ejbStore() and ejbLoad()
b. ejbActivate() and ejbPassivate()
c. ejbStore() and ejbPasivate()
d. ejbLoad() and ejbActivate()
Answer supplied is (b).
It is essentially we are talking about Entity Bean Where ejbActivate() is used to reinitialize the non persistant fields in bean instance i.e. to remove dirty values not synchronizing with the database. As per EJB by Richard Monson-Haefel Pg 200 and ejb specifications the correct answer should be (a).
:roll: [/LIST]
himanshu_airon@yahoo.com