L12Transaction - F28DM Database Management Systems...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
Transaction Management 1 F28DM Database Management Systems Transaction Management Monica Farrow monica@macs.hw.ac.uk Room: EMG30, Ext: 4160 Material on Vision & my web page Content taken from HW & GLA lecturers
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Transaction Management 2 Supporting Concurrent Access Many applications require a lot of users to access the data  simultaneously (e.g. airline booking systems) Uncontrolled simultaneous access can result in chaos, so some  controlling mechanism is required We introduce the notion of the  transaction  to  a id the   dis c us s io n A transaction is a  logical  unit o f wo rk whic h ta ke s  the  DB  fro m  o ne  c o ns is te nt s ta te  to  a no the r, i.e . o b e ying   c o ns tra ints It will probably be made up of smaller operations which temporarily  cause inconsistency
Background image of page 2
Transaction Management 3 Transactions Database transactions are  logical units of work  which  must ALL be performed to maintain data integrity E.g. Move money from one account to another UPDATE Account SET balance = balance – 100 WHERE accountNo = 123; UPDATE Account SET balance = balance + 100 WHERE accountNo = 124; Another example would be a purchase Create order, decrease stock quantity, add payment
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Transaction Management 4 ACID Properties of Transactions Atomicity ALL operations in a transaction must be completed. If not, the  transaction is aborted. The entire transaction is treated as a single,  indivisible unit of work which must be performed completely or not  at all. Consistency If an operation is executed that violates the database’s integrity  constraints, the entire transaction will be rolled back.  A successful transaction takes the database from one state that is  consistent with the rules to another state that is also consistent  with the rules. 
Background image of page 4
Transaction Management 5 ACID Properties of Transactions Isolation Data used within a transaction cannot be used by another  transaction until the first transaction is completed. (or it must  appear that this happened!). The partial effects of incomplete  transactions should not be visible to other transactions. Durability Once the transaction changes have been made, they will survive  failure. The recovery system must ensure this.
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Transaction Management 6 Transactions in Oracle Transactions can consist of one or more SQL commands. In Oracle, a transaction starts when you connect to sqlplus, and ends  when you type COMMIT; If you’re accessing the database from 2 different applications, this explains why  what you’ve altered in one application may not show up in the second.
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 32

L12Transaction - F28DM Database Management Systems...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online