如何判断交易是否为conflict-serializable?

How to determine the whether the transaction is conflict-serializable or not?

我有以下 question:

read(T1, x)
read(T2, x)
write(T1, x)
write(T2, x)
commit(T1)
commit(T2)

State whether the schedule is conflict-serializable, recoverable and avoids cascading abort?

我这样处理问题:

----------------------
|   T1    |   T2     |
----------------------
| read(x) |          |
----------------------
|         | read(x)  |
----------------------
| write(x)|          |
----------------------
|         | write(x) |
----------------------
| commit  |          |
----------------------
|         | commit   |
----------------------

我想是的,因为优先图中没有循环(非循环),所以是conflict-serializable。此外,交易 T1 可以通过交换转换为交易 T2

----------------------
|   T1    |   T2     |
----------------------
| read(x) |          |
----------------------
| write(x)|          |
----------------------
| commit  |          |
----------------------
|         | read(x)  |
----------------------
|         | write(x) |
----------------------
|         | commit   |
----------------------

然而,答案是:

现在,为什么会这样 conflict-seriable?

此致

I thought like, since there was no cycle (acyclic) in the precedence graph , it was conflict-serializable.

假设错误。如果我们绘制优先级图:

时间表不是conflict-serializable

  • 可以恢复吗?

    • 是的。 T1 首先写入 X,然后第一个 T1 被提交。
  • 是无级联的吗?

    • 没有。 T2 不读取提交的数据。
  • 是否级联?

    • 是的。如果出现故障X可以恢复到原来的值