nerdexam
Oracle

1Z0-062 · Question #200

The HR user updates the salary of one of the employees in the EMPLOYEES table, but does not commit the transaction. Which type of lock would this scenario lead to?

The correct answer is B. Row-exclusive lock on the row being updated. In Oracle, a DML operation such as UPDATE acquires a row-level exclusive lock on the specific row being modified, not the entire table.

Managing Data and Concurrency

Question

The HR user updates the salary of one of the employees in the EMPLOYEES table, but does not commit the transaction. Which type of lock would this scenario lead to?

Options

  • AExclusive table-level lock on the EMPLOYEES table
  • BRow-exclusive lock on the row being updated
  • CNull lock on the EMPLOYEES table
  • DNull lock on the row being updated

How the community answered

(34 responses)
  • A
    3% (1)
  • B
    91% (31)
  • D
    6% (2)

Why each option

In Oracle, a DML operation such as UPDATE acquires a row-level exclusive lock on the specific row being modified, not the entire table.

AExclusive table-level lock on the EMPLOYEES table

Oracle does not acquire an exclusive table-level lock for standard DML operations; table-level locks prevent all concurrent access and are contrary to Oracle's row-level locking architecture.

BRow-exclusive lock on the row being updatedCorrect

Oracle's concurrency model uses fine-grained row-level locking. When a user issues an UPDATE, Oracle acquires a TX (transaction) lock at the row level, specifically a row exclusive lock on the affected row. This allows other sessions to concurrently access other rows in the same table without blocking.

CNull lock on the EMPLOYEES table

Null locks in Oracle's lock hierarchy represent no lock held and are used in distributed lock management context, not for active DML operations on a table.

DNull lock on the row being updated

A null lock indicates no resource is held at the row level; a row being actively updated by a transaction holds an exclusive row lock, not a null lock.

Concept tested: Oracle row-level locking during DML operations

Source: https://docs.oracle.com/en/database/oracle/oracle-database/19/cncpt/data-concurrency-and-consistency.html

Topics

#concurrency control#row-level locking#DML locks#transaction management

Community Discussion

No community discussion yet for this question.

Full 1Z0-062 Practice