I came across a question in some sample questions that I downloaded GZ1. Which methods can't have transaction attribute (Choose all apply) 1. onMessage() for MDB 2. remove() for session bean's javax.ejb.EJBObject 3. business method defined in session bean's component interface. 4. method defined in session bean's home interface. 5. method defined in super interface of entity bean's component interface.
The Answer is given to be 4 However I believe, that 2 would also be a correct choice .The specification mentions that for a session bean, methods of the EJBObject and EJBLocalObject need not have a transaction atribute. Can someone please confirm whether my understanding is correct?
For a session bean, the transaction attributes must be specified for the methods defined in the bean�s component interface and all the direct and indirect superinterfaces of the component interface, excluding the methods of the javax.ejb.EJBObject or javax.ejb.EJBLocalObject interface; and for the ejbTimeout method. Transaction attributes must not be specified for the methods of a session bean�s home interface.