• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HFEJP p.520 Q3: Why MUST every business method have a transaction attribute?

 
Darya Akbari
Ranch Hand
Posts: 1855
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I think that Answer B is is not correct. Even the question hints that there are only TWO correct answers.

Do you agree ?



Regards,
Darya
 
Pranav Shukla
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I think option B is also correct. I found the following in EJB Specs Section 17.4.1 page 351


� 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. Transaction attributes must not be specified for
the methods of a session bean�s home interface.
� For an entity 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 getEJBHome, getEJBLocalHome, getHandle, getPrimaryKey,
and isIdentical methods; and for the methods defined in the bean�s home interface
and all the direct and indirect superinterfaces of the home interface, excluding the
getEJBMetaData and getHomeHandle methods specific to the remote home interface.
� For a message-driven bean, the transaction attribute must be specified for the bean�s onMessage
method.


It doesn't clearly state about all business methods in all bean types but indirectly it means the same.
 
Darya Akbari
Ranch Hand
Posts: 1855
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Pranav,

seems that you are right . Your spec quote goes in hand with what I found on p. 498 in HFEJB where it says that "Business methods in the component interface" MUST be marked with an transaction attribute.

Thanks,
Darya
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic