• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
satish shankaran
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic