|
|||
|
Transaction demarcation:-
Session beans are the only ones that can programmatically define bean−managed transaction demarcation; they do this with the javax.transaction. The container is aware of the type of demarcation selected because the container is able to read the <transaction−type> element of the <session> tag in the EJB deployment descriptor. The session bean can access UserTransaction objects (by calling getUserTransaction from its SessionContext object), which make available the begin, commit, and rollback methods for the transaction. With session beans, you may set the <transaction−type> element because session beans have the option of using container−managed transaction−management services. However, the <transaction−type> does not exist for entity beans. Container−managed transaction−management services are provided by the container, and the deployment descriptor has a <container−transaction> element within the <assembly−descriptor> element. The transactions of the methods described in these elements are automatically managed by the container. |