- 1、本文档共68页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
(T1,T2) R(A,t);t:=t+2;W(A,t); R(A,s);s:=s+3;W(A,s); R(B,t);t:=t*3;W(B,t); R(B,s);s:=s*2;W(B,s) 2 serial schedules and 402 serializable schedules (T1, T2): T1: R(A,t);t:=t+2;W(A,t); | R(B,t);t:=t*3;W(B,t); A0+2 3B0 T2: R(B,s);s:=s*2;W(B,s); | R(A,s);s:=s+3;W(A,s); 6B0 A0+5 (T2, T1): T2: R(B,s);s:=s*2;W(B,s); | R(A,s);s:=s+3;W(A,s); 2B0 A0+3 T1: R(A,t);t:=t+2;W(A,t); | R(B,t);t:=t*3;W(B,t); A0+5 6B0 The three writes create three versions of A. When T2 tries to read A, it is given the value that it itself wrote, since that is the version with the greatest timestamp that does not exceed the timestamp of T2. That makes sense, although in practice, we doubt that a well written transaction would read its own value through the database storage system. When T4 tries to read A the system finds that T4s timestamp is larger than that of any version of A written. Thus, T4 gets the version with the largest of the timestamps, the one written by T3. That makes sense, because in the hypothetical serial order based on the timestamps of the transactions, T3 would be the last to write A. As T1 is the first to validate, there is nothing to check; T1 validates successfully. T3 validates next. The only other validated transaction is T1, and T1 has not yet finished. Thus, both the read- and write-sets of T3 must be compared with the write-set of T1. However, T1 writes only A, and T3 neither reads nor writes A, so T3s validation succeeds. Last, T2 validates. Both T1 and T3 finish after T2 started, so we must compare the read-set of T2 with the write-sets of both T1 and T3. Since B is in both W3 and R2, we cannot validate T2. Note that since T3 (but not T1) finishes after T2 validates, we would also compare the write set of T2 with the write set of T3, ha
文档评论(0)