大家好!最近在看oracle concept 第13章 数据并发性与数据一致性。
其中的一节: 
Row Share Table Locks (RS)row share table lock is the least restrictive mode of table lock, 
offering the highest degree of concurrency for a table.Permitted Operations: A row share table lock held by a transaction allows other transactions to query, insert, update, delete, or lock rows concurrently in the same table. 
Therefore, other transactions can obtain simultaneous row share, row exclusive, share, and share row exclusive table locks for the same table.这段大致说的是:某个事务拥有了某个表的行共享表级锁后,其他事务依然可以并发地对相同数据表执行查询,插入,更新,删除操作,或对表内数据行加锁的操作。如果通过select ... from for update of ;
对表进行共享行锁定,其他的事物如果在对这样写被锁定的行进行update操作,应该是会发生阻塞。
请教大家,手册上为什么说:
其他事务依然可以并发地对相同数据表执行查询,插入,更新,删除操作

解决方案 »

  1.   

    我的想法是
    在行上进行的锁定是排他锁,其他事务要对锁定的行进行操作要进行等待,直到锁释放
    拥有行级锁的事务同时会得到一个表上的共享锁,防止其他事务对其进行alter等操作。但可以对该表进行查询、插入,以及该行以外的行进行更新,删除操作。当查询到被锁定的行时,从撤销段中读取
      

  2.   

    注意文档是指是'in the same table',指对相同数据表的“不同行”操作。
    前提是select ... from t where ... for update; 带where子句限定行。
    如果对整表for update,自然没法做其他dml。
      

  3.   

    for update操作时对过滤出来的结果是进行排他的独占锁定的