浙江大学数据库系统概念第十五章.pptxVIP

  • 1
  • 0
  • 约1.34万字
  • 约 31页
  • 2024-01-26 发布于河南
  • 举报

Chapter15:TransactionsTransactionConceptConcurrentExecutionsSerializabilityTestingforSerializabilityRecoverabilityTransactionDefinitioninSQL浙江大学数据库系统概念第十五章共31页,您现在浏览的是第1页!

TransactionConceptE.g.Transactiontotransfer$50fromaccountAtoaccountB:1. read(A) 4.read(B)2. A:=A–50 5.B:=B+503. write(A) 6.write(BAtransactionisaunitofprogramexecutionthataccessesandpossiblyupdatesvariousdataitems.Atransactionmustseeaconsistentdatabase.Duringtransactionexecutionthedatabasemaybeinconsistent.Whenthetransactionismitted,thedatabasemustbeconsistent.Twomainissuestodealwith:Failuresofvariouskinds,suchashardwarefailuresandsystemcrashesConcurrentexecutionofmultipletransactions浙江大学数据库系统概念第十五章共31页,您现在浏览的是第2页!

ACIDPropertiesAtomicity.Eitheralloperationsofthetransactionareproperlyreflectedinthedatabaseornoneare.CommitatransactionRollbackatransactionConsistency.Executionofatransactioninisolationpreservestheconsistencyofthedatabase.Isolation.Althoughmultipletransactionsmayexecuteconcurrently,eachtransactionmustbeunawareofotherconcurrentlyexecutingtransactions.Intermediatetransactionresultsmustbehiddenfromotherconcurrentlyexecutedtransactions.Durability.Afteratransactionpletessuccessfully,thechangesithasmadetothedatabasepersist,eveniftherearesystemfailures.Topreserveintegrityofdata,thedatabasesystemmustensure:浙江大学数据库系统概念第十五章共31页,您现在浏览的是第3页!

ExampleofFundTransferTransactiontotransfer$50fromaccountAtoaccountB:1. read(A)2. A:=A–503. write(A)4. read(B)5. B:=B+506. write(B)Consistencyrequirement–thesumofAandBisunchangedbytheexecutionofthetransaction.Atomicityrequirement—ifthetransactionfailsafterstep3andbeforestep6,thesystemshouldensurethatitsupdatesarenotreflectedinthedatabase,elseaninconsistencywillresult.Failurecouldbeduetosoftwareorhardw

文档评论(0)

1亿VIP精品文档

相关文档