Hello All, What is the default transaction attribute set for methods of the Session/Entity bean when the transaction attribute is not explicitly mentioned in the XML file? Thanks, Ashutosh
posted 12 years ago
There is no default transaction setting dictated by the EJB Specification:
EJB 2.0 Specification, Section 17.5 The Deployer is responsible for ensuring that the methods of the deployed enterprise beans with container-managed transaction demarcation have been assigned a transaction attribute. If the transaction attributes have not been assigned previously by the Assembler, they must be assigned by the Deployer.
If you do not specify a transaction attribute for methods in an EJB then it's transactional behavior will depend on the particular EJB Container that you are using. In the case of WebLogic, if a transaction attribute is not specified then the EJB or method behaves as if it has a transactional setting of "Supports". JBoss, on the other hand, seems to default to "Required". For the sake of portability, you should always specify a transaction setting for your EJBs.