Marking transactions in the DD
All beans must say whether they’re using bean- or container-managed transactions. For BMT beans, that’s it for the DD.
But for CMT beans that’s just the beginning.
Transaction-related DD info lives in two places
For both CMT and BMT beans:
The <transaction-type> element in the <enterprise-beans> section
For CMT beans only:
The <container-transaction> element in the <assembly-descriptor> section
<assembly-descriptor> <container-transaction> <method> <ejb-name>MyBean</ejb-name> <method-name>bar</method-name> </method> <trans-attribute>Required</trans-attribute> </container-transaction> </assembly-descriptor>
Get Head First EJB now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.