- Read Consistency (읽기 일관성)
1) Readers do NOT wait for writers
2) Writers do NOT wait for readers
[Session1] [Session2]
-- Read consistency
create table t_book -- DDL
(no number,
name varchar2(10));
desc t_book
insert into t_book values (1000, 'Jack1'); -- DML
insert into t_book values (2000, 'Java');
select * from t_book;
NO NAME
----- ----------
1000 Jack1
2000 Java
desc t_book
select * from t_book;
no rows selected
commit;
select * from t_book;
NO NAME
----- ----------
1000 Jack1
2000 Java
-- Lock
update t_book
set name = 'Luke'
where no = 1000;
update t_book
set name = 'Lake'
where no = 1000;
|wait!
rollback;
1 row updated.
rollback;
-- Deadlock
update t_book
set name = 'Luke'
where no = 1000;
update t_book
set name = 'James'
where no = 2000;
update t_book
set name = 'James'
where no = 2000;
|wait!
update t_book
set name = 'Lake'
where no = 1000;
|wait!
ORA-00060: deadlock detected
while waiting for resource
commit;
1 row updated.
commit;
'Oracle > SQL Fundamentals I' 카테고리의 다른 글
10일차 # 8-29: Implicit Transaction Processing (0) | 2012.04.17 |
---|---|
10일차 # 8-27: COMMIT, ROLLBACK, SAVEPOINT (0) | 2012.04.17 |
10일차 # 8-24: Transaction (Tx) (0) | 2012.04.17 |
10일차 # 8-21: TRUNCATE Statement (0) | 2012.04.17 |
10일차 # 8-18: DELETE Statement (0) | 2012.04.17 |