Transaction Processing Flashcards
what is transaction Processing
A mechanism for describing logical units of database processing.
Systems with large databases and hundreds of concurrent users
give examples of transaction processing systems (3)
airline reservations
banking
credit card processing
describe single vs multi user
single- only one access at one time
multi- many users accessing the database
what is interleaving
processes are interleaved to achieve the illusion of concurrency
what are transactions
executing programs
what is a DBMS buffer
In ram, contents swapped out to disk when full
using LRU
what is concurrency
several accesses at the same time are likely to allow concurrent access
what are the problems caused by concurrency (4)
lost update
unrepeatable read
dirty read/temporary update
incorrect summary
what is the lost update problem
2 transactions access the same items such that a value becomes incorrect
what is the dirty read/temporary update problem
a process will read a value when it is in a state. Then the transaction that set that will fail and it will be reverted back.
but the other process has already operated on the incorrect data
what is the unrepeatable read problem
a process will read a value and read it again and it will be different each time
what is the incorrect summary problem
one of the transactions is executing an aggregate operation on several data items, and other transactions are updating one or more of those data items. This causes a inconsistent database state
what risks are there to transactions
computer failure
physical problems
transaction error
logical error or exception
concurrency control enforcement
what happens if a transaction aborts
roll back
what are the transaction states
active partially committed failed committed aborted terminated
what does it mean to say a transaction is atomic
it will either complete or it will not
what are the desirable properties of a transaction (ACID)
atomic- either completes or doesn’t
consistency preservation- state to state
isolated- appear to work as though isolated
durability or permanency- changes made by a transaction must not be lost
what is a schedule
consists of a number of transactions with an ordering of operations
what are the 3 conditions of conflicting operations
one is write
different transactions
access same variable
what is a complete schedule
operations are exactly T1 to N
for 2 operations in T, order in S is preserved
for 2 conflicting operations, one occurs before the other
what is the easy approach to create a serialised schedule
each transaction runs after another in full
when is a schedule serial
if it is equivaled to some serial schedule of the same n transactions
how many possible serial schedules are there
n!
what is result equivalence
if two schedules produce the same result
what is conflict equivalence
the relative order of any two conflicting operations is the same
what is non conflicting equivalence
when conflicting operations are applied in different orders in two schedules
how do we graph transactions
have a graph for each transaction. if they conflict, draw a line from one to the other.
r(x) -> w(x)
w(x) -> r(x)
w(x) -> w(x)
if there is a cycle, the schedule is not serializable