跳至主要内容

博文

目前显示的是 十二月, 2018的博文

Deep in Transaction (3)

Deep in Transaction (3) In last blog, we talk about four kinds of problems when we lack of a reasonable implementation of transaction: Lost Update; Inconsistent Retrieval; Dirty Read; Premature Write; Today, we focus on how we make it. How The first tool we can come up with when dealing with concurrent access problem is locking. Besides it, we will also see how optimistic concurrency control and timestamp order make it. Lock The basic idea of lock is very simple: when multiple clients want to access same object, only one client will get the lock and continue, other clients will wait until lock is free – Serialization between multiple clients. In the context of Transaction , lock is relative complex. Two Phase Locking We have introduced the conflict operations between transactions, and in order to solve it we can make transaction serially equivalent (or totally serialization). In details, Serial Equivalence requires that all of a transaction’s