• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

Doubt about transaction attributes that can be specified for bean methods  RSS feed

 
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
 
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!!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!