Question: Does oracle 12c aquire automatically a table lock when it aquires a row lock?

Question

Does oracle 12c aquire automatically a table lock when it aquires a row lock?

Answers 1
Added at 2017-01-03 22:01
Tags
Question

It says on the documentation that oracle 12c, aquires a table lock when a row lock is aquired.That is not so in sql server, it is very baffling.

A row lock, also called a TX lock, is a lock on a single row of a table. A transaction acquires a row lock for each row modified by one of the following statements: INSERT, UPDATE, DELETE, MERGE, and SELECT ... FOR UPDATE. The row lock exists until the transaction commits or rolls back.

***When a transaction obtains a row lock for a row, the transaction also acquires a table lock for the table in which the row resides***. The table lock prevents conflicting DDL operations that would override data changes in a current transaction.

Can somebody elucidate this?

Answers to

Does oracle 12c aquire automatically a table lock when it aquires a row lock?

nr: #1 dodano: 2017-01-03 22:01

The table lock that occurs is a shared lock. There can be any number of shared locks allowed on the same table at the same time: they do not interfere with one another.

What they do do is prevent anything from acquiring an exclusive lock on that table: say, to change the structure of the table.

Source Show
◀ Wstecz