2

Everybody says that

"Serializable" means that for any given set of concurrent transactions, there is a serial ordering of those transactions which produces the same result.

They also give an example

suppose you have an attribute whose initial value is 10; and you have two transactions - one which doubles the value, the other which adds seven. Two different clients initiate the two transactions. Under isolated semantics, the only acceptable values for this attribute are 27 (the result of doubling first then adding 7) and 34 (the result of adding 7 first and then doubling). Any other value (such as 20 or 17) would be an error.

Which "same result" do we have in the example? Which reordering can we have to produce the same result?

7

Which "same result" do we have in the example? Which reordering can we have to produce the same result?

The opening quote is an incorrect statement of serializable isolation.

The definition of the serializable isolation level in the SQL-92 standard contains the following text (emphasis mine):

A serializable execution is defined to be an execution of the operations of concurrently executing SQL-transactions that produces the same effect as some serial execution of those same SQL-transactions. A serial execution is one in which each SQL-transaction executes to completion before the next SQL-transaction begins.

The example given is consistent with that definition.

The text above is taken from my article The Serializable Isolation Level

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.