nerdexam
Oracle

1Z0-062 · Question #373

An employee salary in the non-partitioned EMPLOYEES table, has been updated but the transaction is uncommitted. Which two types of lock are held by the transaction? (Choose two.)

The correct answer is A. a row level lock on the row being updated C. a row shared lock on the EMPLOYEES table. When a row is updated in an Oracle table and the transaction is uncommitted, the database holds an exclusive lock on that specific row and a row shared lock on the entire table.

Managing Data and Concurrency

Question

An employee salary in the non-partitioned EMPLOYEES table, has been updated but the transaction is uncommitted. Which two types of lock are held by the transaction? (Choose two.)

Options

  • Aa row level lock on the row being updated
  • Ba null lock on the row being updated
  • Ca row shared lock on the EMPLOYEES table
  • Dan exclusive lock on the EMPLOYEES table
  • Ea null lock on the EMPLOYEES table

How the community answered

(50 responses)
  • A
    70% (35)
  • B
    8% (4)
  • D
    4% (2)
  • E
    18% (9)

Why each option

When a row is updated in an Oracle table and the transaction is uncommitted, the database holds an exclusive lock on that specific row and a row shared lock on the entire table.

Aa row level lock on the row being updatedCorrect

When a row is updated, an exclusive row-level lock (TX lock) is placed on that specific row to prevent other transactions from modifying it until the current transaction commits or rolls back.

Ba null lock on the row being updated

A null lock provides no restrictions and is not held on the row being updated by an active modification transaction.

Ca row shared lock on the EMPLOYEES tableCorrect

An `UPDATE` operation implicitly acquires a Row Share (RS) lock on the table, which allows concurrent DML operations but prevents conflicting DDL operations that would change the table structure.

Dan exclusive lock on the EMPLOYEES table

An exclusive lock on the table (`EXCLUSIVE` lock) prevents all other DML and DDL operations, which is too restrictive for a standard row-level `UPDATE` operation.

Ea null lock on the EMPLOYEES table

A null lock provides no restrictions and is not held on the table by an active modification transaction.

Concept tested: Oracle Transaction Locks (Row and Table)

Source: https://docs.oracle.com/en/database/oracle/oracle-database/19/adgrm/oracle-database-concurrency-and-locking.html#GUID-D20F205B-D350-4826-8D63-B8497C198A00

Topics

#Locks#row-level lock#table lock#uncommitted transaction

Community Discussion

No community discussion yet for this question.

Full 1Z0-062 Practice