Originally posted by Steven Gao Song:
Hi, everyone,
HFEJB Page 509, it says that A CMT session bean must specify attributes for all business methods in the component interface. I am confused.
For example, I have a business method advice() in the component interface, it just returns a piece of advice generated by the session bean, why it MUST be specified a transaction attribute? Who could explain for me? Thank you very much.
Hello, this is a requirement of
EJB 2.0 (ejb-2_0-fr2-spec.pdf):
Please look at page 351 of EJB 2.0 (section 17.4.1) :
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.
...
They (attributes) must be defined either by Application Assembler or Deployer.
regards,
MZ