Support for transactions is an essential component of the Enterprise JavaBeans architecture. The enter-prise
Bean Provider and the client application programmer are not exposed to the complexity of distrib-uted
transactions. The Bean Provider can choose between using programmatic transaction demarcation
in the enterprise bean code (this style is called bean-managed transaction demarcation) or declarative
transaction demarcation performed automatically by the EJB Container (this style is called con-tainer-
managed transaction demarcation).
With bean-managed transaction demarcation, the enterprise bean code demarcates transactions using
the javax.transaction.UserTransaction interface. All resource manager  accesses
between the UserTransaction.begin and UserTransaction.commit calls are part of a
With container-managed transaction demarcation, the Container demarcates transactions per instruc-tions
provided by the Application Assembler in the deployment descriptor. These instructions, called
transaction attributes, tell the container whether it should include the work performed by an enterprise
bean method in a client’s transaction, run the enterprise bean method in a new transaction started by the
Container, or run the method with “no transaction”
Regardless whether an enterprise bean uses bean-managed or container-managed transaction demarca-tion,
the burden of implementing transaction management is it on the EJB Container and on the Server Provider.
Does the EJB Container and Server implement the necessary low-level transaction protocols, such as the
two-phase commit protocol between a transaction manager and a database system or JMS provider,
transaction context propagation, and distributed two-phase commit?