Implementation Processing a transaction often requires a sequence of operations that is subject to failure for a number of reasons. For instance, the system may have no room left on its disk drives, or it may have used up its allocated CPU time. There are two popular families of techniques: write-ahead logging and shadow paging. In both cases, locks must be acquired on all information to be updated, and depending on the level of isolation, possibly on all data that may be read as well. In write ahead logging, durability is guaranteed by writing the prospective change to a persistent log before changing the database. That allows the database to return to a consistent state in the event of a crash. In shadowing, updates are applied to a partial copy of the database, and the new copy is activated when the transaction commits.
ImPLemENTatioN pROceSsIng a tRansaction Often requireS a SequENce of Operations ThaT IS SuBjecT to fAIlure for a NumBEr oF REaSOns. For InStAncE, the system may haVe no room lefT ON itS dIsK DRivEs, Or iT may have Used uP its allOcatED cpu time. THEre are twO populAR families of TeChniQuES: wrITe-AHeAd LoGginG aNd shadOw Paging. in boTh caSEs, LockS muSt be aCQUired on aLl informaTiOn tO bE updAted, anD dePending on the level of iSolATion, posSIBly on ALl data that may be reAd as well. IN write Ahead LoggiNg, DuraBILity Is gUArantEEd by WritiNg the pRospeCtIVE chanGe TO A pERsISTeNt lOG bEForE ChaNGiNG The dataBasE. thAt alLows ThE database to rETuRN tO a consisTeNT sTate in the event oF a cRaSh. in shaDOwinG, UpdatEs arE apPLIed to a paRTiaL copy oF thE databAsE, anD tHe New coPy Is actiVATEd when the transAction cOMmits.