Presentation is loading. Please wait.

Presentation is loading. Please wait.

April 20023CSG11 Electronic Commerce Transaction processing John Wordsworth Department of Computer Science The University of Reading

Similar presentations


Presentation on theme: "April 20023CSG11 Electronic Commerce Transaction processing John Wordsworth Department of Computer Science The University of Reading"— Presentation transcript:

1 April 20023CSG11 Electronic Commerce Transaction processing John Wordsworth Department of Computer Science The University of Reading J.B.Wordsworth@rdg.ac.uk Room 129, Ext 6544

2 April 20023CSG12 Lecture objectives Introduce the notion of a transaction Understand the role of the transaction manager and resource managers in transaction processing Describe the use of locks to protect resources Understand the two-phase commit protocol for data integrity

3 April 20023CSG13 What is a transaction A (small?) piece of work done in tier 3 to satisfy a request from tier 1:  Cash withdrawal from an ATM  Add details of a new retail customer Types of transactions:  Inquiry – changes nothing  Simple update – changes one thing, or many things under the control of one resource manager (DBMS)  Complex update – changes things under the control of more than one resource manager

4 April 20023CSG14 Transaction program A transaction program is a repository of business logic:  Analyse the transaction request  Get the resource managers to change the resources  Send the response

5 April 20023CSG15 Resource manager Know who is asking for changes Advise transaction manager about interest in transactions Manage locks on resources Make provisional changes to resources Be prepared to:  Commit the changes  Rollback the changes

6 April 20023CSG16 Locking Read R1 R1’ (B) R1 (A) R1 (free) Txn BTxn AR Mgr Commit Write R1’ R1’ (A)

7 April 20023CSG17 Transaction manager Keep account of transactions that are active Keep account of which resource managers have interests in which transactions Manage the committing (at normal end of transaction) or rolling back (at abnormal end of transaction) of the provisional changes made by a transaction in order to maintain data integrity For multiple resource managers, use the two-phase commit protocol

8 April 20023CSG18 Transaction processing monitor Provides an environment for multiple transaction processing programs:  Access to resource mangers (files, databases, devices, …)  Access to private resources (storage, temporary storage queues, …) Provides transaction management facilities Provides operations management facilities (distributed transaction processing, multiple platforms, …)

9 April 20023CSG19 Two-phase commit (1) Prepare Commit OK RM1 RM2 Transaction Manager

10 April 20023CSG110 Two-phase commit (2) Prepare Rollback OK RM1 RM2 Transaction Manager

11 April 20023CSG111 Key points Transactions are small pieces of work Resource mangers use locks to maintain the integrity of their resources The transaction manager uses two-phase commit protocol to maintain data integrity of all resources


Download ppt "April 20023CSG11 Electronic Commerce Transaction processing John Wordsworth Department of Computer Science The University of Reading"

Similar presentations


Ads by Google