• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Doubt about transaction attributes that can be specified for bean methods

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply!!
 
reply
    Bookmark Topic Watch Topic
  • New Topic