In the EJB HeadFirst on p509 they say for CMT: Compulsory for entity beans.
Now . . . I have been using entity beans (and session beans for that matter) without using a single <container-transaction > in the <assembly-descriptor> section in my DD(ejb.jar). Does the container automaticly use the 'Required' attribute for ALL the buisiness methods for a entity bean? (I am using JBoss btw).
As for the session beans , <transaction-type>Container/Bean</transaction-type> is always present in the <enterprise-beans> section , but what if nothing for that bean is spesified in <container-transaction > in the <assembly-descriptor> section - does the methods run in no transaction or is it also 'Required' for all by default ?
Entity Beans can Use only CMT. The treansaction attribute if not specified then it depends upon the container. Weblogic 8.1 uses Supports as default. Not sure about jboss.
Sawan<br />SCJP,SCWCD,SCBCD<br /> <br />Every exit is an entry somewhere.
Joined: Dec 14, 2004
can you choose not to use transactions for entity beans - ie. it is not a must to use transactions.
Joined: Aug 24, 2004
This is a intresting question . The EJBLoad and EJBStore methods are called with the start of a new transaction and not with every method call . That means on the basis of the transaction the container decides when to load and store.
I am not very sure but for select and finder methods specifiying no transaction makes sense but for other things we definitely need transactions.