Presentation is loading. Please wait.

Presentation is loading. Please wait.

Version # Software Engineering Institute Carnegie Mellon University Pittsburgh, PA 15213-3890 Sponsored by the U.S. Department of Defense © 1999 by Carnegie.

Similar presentations


Presentation on theme: "Version # Software Engineering Institute Carnegie Mellon University Pittsburgh, PA 15213-3890 Sponsored by the U.S. Department of Defense © 1999 by Carnegie."— Presentation transcript:

1 Version # Software Engineering Institute Carnegie Mellon University Pittsburgh, PA 15213-3890 Sponsored by the U.S. Department of Defense © 1999 by Carnegie Mellon University Delete this red box (from the title master) after creating all of your slides. Keep everything inside the “safe area” for correct display. Enterprise JavaBeans. - page 1 EJB Transactions

2 © 1999 by Carnegie Mellon University Version # Delete this red box (from the slide master) after creating all of your slides. Keep everything inside the “safe area” for correct display. Course or Lecture or Module Info. - page 2 Distributed Transactions EJB allows application developers to write applications that atomically update data in multiple databases may be distributed across multiple sites sites may use EJB Servers from different vendors The enterprise Bean Provider and the client application programmer are not exposed to the complexity of distributed transactions.

3 © 1999 by Carnegie Mellon University Version # Delete this red box (from the slide master) after creating all of your slides. Keep everything inside the “safe area” for correct display. Course or Lecture or Module Info. - page 3 ACID Properties Atomicity. In a transaction involving two or more discrete pieces of information, either all of the pieces are committed or none are. Consistency. A transaction either creates a new and valid state of data, or, if any failure occurs, returns all data to its state before the transaction was started. Isolation. A transaction in process and not yet committed must remain isolated from any other transaction. Durability. Committed data is saved by the system such that, even in the event of a failure and system restart, the data is available in its correct state.

4 © 1999 by Carnegie Mellon University Version # Delete this red box (from the slide master) after creating all of your slides. Keep everything inside the “safe area” for correct display. Course or Lecture or Module Info. - page 4 Programmatic vs. Declarative Transaction Demarcation Bean-managed transaction demarcation enterprise bean code demarcates transactions using javax.transaction.UserTransaction accesses between UserTransaction.begin and UserTransaction.commit calls are part of a transaction Container-managed transaction demarcation container demarcates transactions per instructions provided by the Application Assembler in the deployment descriptor

5 © 1999 by Carnegie Mellon University Version # Delete this red box (from the slide master) after creating all of your slides. Keep everything inside the “safe area” for correct display. Course or Lecture or Module Info. - page 5 Container-Managed Transaction Demarcation NotSupported - container invokes enterprise Bean method with an unspecified transaction context Required - container invokes enterprise Bean method with a valid transaction context Supports If the client calls with a transaction context, same as Required If the client calls without a transaction context, same as NotSupported

6 © 1999 by Carnegie Mellon University Version # Delete this red box (from the slide master) after creating all of your slides. Keep everything inside the “safe area” for correct display. Course or Lecture or Module Info. - page 6 Container-Managed Transaction Demarcation - 2 RequiresNew - container invokes enterprise Bean method with a new transaction context Mandatory - container invokes enterprise Bean method with the client’s transaction context Never - container invokes an enterprise Bean method without a transaction context client is required to call without a transaction context

7 © 1999 by Carnegie Mellon University Version # Delete this red box (from the slide master) after creating all of your slides. Keep everything inside the “safe area” for correct display. Course or Lecture or Module Info. - page 7 Isolation Levels Describes the degree to which access to a resource manager by a transaction is isolated from other concurrently executing transactions Part of the EJB 1.0 specification -- has been eliminated in EJB 1.1! API for managing an isolation level is resource- manager specific bean provider may specify the same or different isolation levels for each resource manager

8 © 1999 by Carnegie Mellon University Version # Delete this red box (from the slide master) after creating all of your slides. Keep everything inside the “safe area” for correct display. Course or Lecture or Module Info. - page 8 Updates to Multiple Databases DB A DB B DB C Client X Y Server Multiple databases Single transaction

9 © 1999 by Carnegie Mellon University Version # Delete this red box (from the slide master) after creating all of your slides. Keep everything inside the “safe area” for correct display. Course or Lecture or Module Info. - page 9 Updates to Multiple Databases in Same Transaction DB A DB B X EJB Server Y client

10 © 1999 by Carnegie Mellon University Version # Delete this red box (from the slide master) after creating all of your slides. Keep everything inside the “safe area” for correct display. Course or Lecture or Module Info. - page 10 Updates to Multiples Databases on Multiple Servers DB TP begin commit X Y EJB Server client

11 © 1999 by Carnegie Mellon University Version # Delete this red box (from the slide master) after creating all of your slides. Keep everything inside the “safe area” for correct display. Course or Lecture or Module Info. - page 11 Two-Phase Commit (2PC) JDBC 1.2 does not support XA two phase commit impossible for an EJB server using JDBC 1.2 to directly support for distributed transactions Distributed transactions requires the existence of database drivers that support XA 2PC in most cases, developers are relying on the vendor to provide database drivers

12 © 1999 by Carnegie Mellon University Version # Delete this red box (from the slide master) after creating all of your slides. Keep everything inside the “safe area” for correct display. Course or Lecture or Module Info. - page 12 Relationship to JTA and JTS Java Transaction API (JTA) Java Transaction Service (JTS)

13 © 1999 by Carnegie Mellon University Version # Delete this red box (from the slide master) after creating all of your slides. Keep everything inside the “safe area” for correct display. Course or Lecture or Module Info. - page 13 Java Transaction API (JTA)

14 © 1999 by Carnegie Mellon University Version # Delete this red box (from the slide master) after creating all of your slides. Keep everything inside the “safe area” for correct display. Course or Lecture or Module Info. - page 14 Java Transaction API (JTA) JTA specifies the interfaces between a transaction manager and the other parties involved in a distributed transaction processing system application programs resource managers application server

15 © 1999 by Carnegie Mellon University Version # Delete this red box (from the slide master) after creating all of your slides. Keep everything inside the “safe area” for correct display. Course or Lecture or Module Info. - page 15 Java Transaction Service (JTS) Java binding of the CORBA Object Transaction Service (OTS) 1.1 specification Provides transaction interoperability using the standard IIOP protocol for transaction propagation between servers Intended for vendors who implement transaction processing infrastructure for enterprise middleware may be used by an EJB Server vendor as the underlying transaction manager

16 © 1999 by Carnegie Mellon University Version # Delete this red box (from the slide master) after creating all of your slides. Keep everything inside the “safe area” for correct display. Course or Lecture or Module Info. - page 16 EJB Relationship to JTA and JTS Does not require the EJB Container to support the JTS interfaces Requires that the EJB Container support the javax.transaction.UserTransaction interface defined in JTA Does not require support for JTA resource manager (XAResource) application server interfaces

17 © 1999 by Carnegie Mellon University Version # Delete this red box (from the slide master) after creating all of your slides. Keep everything inside the “safe area” for correct display. Course or Lecture or Module Info. - page 17 Summary Transaction-based systems can be implemented simply using EJB Transactions are not simple -- transaction behavior is affected by choice of session bean or entity bean statefull or stateless session bean bean-managed vs. container-managed transaction demarcation transaction attributes lots more stuff!

18 © 1999 by Carnegie Mellon University Version # Delete this red box (from the slide master) after creating all of your slides. Keep everything inside the “safe area” for correct display. Course or Lecture or Module Info. - page 18 References [ 1 ] Java Transaction API (JTA). http://java.sun.com/products/jta. [ 2 ] Java Transaction Service (JTS). http://java.sun.com/products/jts. [ 3 ] OMG Object Transaction Service. http://www.omg.org/corba/sectrans.htm#trans.

19 © 1999 by Carnegie Mellon University Version # Delete this red box (from the slide master) after creating all of your slides. Keep everything inside the “safe area” for correct display. Course or Lecture or Module Info. - page 19 For More Information... Telephone412 / 268-5800 Fax412 / 268-5758 Emailrcs@sei.cmu.edu World Wide Webhttp://www.sei.cmu.edu U.S. mailCustomer Relations Software Engineering Institute Carnegie Mellon Pittsburgh, PA 15213-3890


Download ppt "Version # Software Engineering Institute Carnegie Mellon University Pittsburgh, PA 15213-3890 Sponsored by the U.S. Department of Defense © 1999 by Carnegie."

Similar presentations


Ads by Google