File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Why transaction attributes can't be specified for session bean home interface? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Why transaction attributes can Watch "Why transaction attributes can New topic
Author

Why transaction attributes can't be specified for session bean home interface?

satish shankaran
Greenhorn

Joined: Aug 05, 2002
Posts: 3
From the spec it says that

A transaction attribute is a value associated with a method of a session or entity bean�s home or component interface or with the onMessage method of a message-driven bean. The transaction attribute specifies how the Container must manage transactions for a method when a client invokes the method
via the enterprise bean�s home or component interface or when the method is invoked as the result of the arrival of a JMS message.
The transaction attribute must be specified for the following methods:
� 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.

In the first para it says that "A transaction attribute is a value associated with a method of a session or entity bean�s home or component interface " and in the last para it says that "Transaction attributes must not be specified for the methods of a session bean�s home interface".

Can some body please explain what's going on here,iam confused.Thanks for your help.
Roger Chung-Wee
Ranch Hand

Joined: Sep 29, 2002
Posts: 1683
Transaction attributes must be specified for the business methods of both entity and session beans. They must not be specified for the methods of a session bean's home interface because these methods are not part of a client's transaction. However, an entity bean's home interface has methods like create() and remove() which involve database operations and are therefore transactional.


SCJP 1.4, SCWCD 1.3, SCBCD 1.3
 
jQuery in Action, 2nd edition
 
subject: Why transaction attributes can't be specified for session bean home interface?