Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt about transaction attributes that can be specified for bean methods

 
paresh vernekar
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?

Regards,
Paresh Vernekar
 
Kedar Dravid
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From the EJB specification:

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.

So, 2 should also qualify as a correct choice.
 
paresh vernekar
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic