SQL> lock table state in exclusive mode;
Table(s) Locked.
SQL> insert into state(state_cd,state_name) values ('NM','Neimenggu'); 1 row created. SQL> select * from state; STAT STATE_NAME ---- ------------------------------ AZ Arizona NJ New Jersey NM Neimenggu SQL> rollback; Rollback complete. SQL> select * from state; STAT STATE_NAME ---- ------------------------------ AZ Arizona NJ New Jersey
插入以后可以看到数据,
但是回滚以后,就回到插入以前的状态了,
把回滚前插入的数据取消了。
rollback命令执行之后,
给state表加的锁就自动解开了。