DatabaseManagementSystems3ed,R.RamakrishnanandJ.Gehrke 1
TransactionManagementOverview
Chapter16
DatabaseManagementSystems3ed,R.RamakrishnanandJ.Gehrke 2
Transactions
- Concurrentexecutionofuserprogramsisessentialfor
goodDBMSperformance.
✁Becausediskaccessesarefrequent,andrelativelyslow,itis importanttokeepthecpuhummingbyworkingonseveral userprogramsconcurrently.
- Auser’sprogrammaycarryoutmanyoperationson
thedataretrievedfromthedatabase,buttheDBMSis
- nlyconcernedaboutwhatdataisread/written
from/tothedatabase.
- Atransaction istheDBMS’sabstractviewofauser
program:asequenceofreadsandwrites.
DatabaseManagementSystems3ed,R.RamakrishnanandJ.Gehrke 3
ConcurrencyinaDBMS
- Userssubmittransactions,andcanthinkofeach
transactionasexecutingbyitself.
✁ConcurrencyisachievedbytheDBMS,whichinterleaves actions(reads/writesofDBobjects)ofvarioustransactions.
✁Eachtransactionmustleavethedatabaseinaconsistent stateiftheDBisconsistentwhenthetransactionbegins.
- DBMSwillenforcesomeICs,dependingontheICs
declaredinCREATETABLEstatements.
- Beyondthis,theDBMSdoesnotreallyunderstandthe
semanticsofthedata.(e.g.,itdoesnotunderstandhow theinterestonabankaccountiscomputed).
- Issues: Effectofinterleaving transactions,andcrashes.