Concept and Examples
Levels of transactions
Read-Only Transactions
- everybody could read at the same time
- increase the parallelism of read only
Isolation Levels of Transactions
- level을 설정할 수 있음.
- locking
- exclusive access to database
- exclusive permission to table.
- more considering effect of it.
- Serializable (level3)
- Repeatable read(level2)
- read committed(level 1)
- read uncommitted(level 0)
- 밑으로 갈수록 performance는 향상되고 data integrity는 감소됨.
Possible Issues
- Phantom read
- 여러개의 select를 날릴 때, 다른 tx의 insert에 의해 시간이 지남에 따라 결과가 달라진다.
- INSERT
- Nonrepeatable read
- Dirty read
- commit되지 않은 data가 읽히는 것.
- non committed yet.
Serializable tx
Repeatable read
- update를 하면, undo table을 만든다. → undo table을 거쳐서 결과가 나오게 된다.
- insert를 하면, repeatable read가 생기지 않고 insert된께 나오게 된다. → phantom read
- no nonrepeatable read
- no dirty read