nerdexam
Oracle

1Z0-873 · Question #13

You want to lock the three tables a, b and c, and issue the following statements: mysql> LOCK TABLES a READ; mysql> LOCK TABLES b READ; mysql> LOCK TABLES c READ; Which tables are now locked?

The correct answer is C. Table c only. If you need to use multiple tables while holding an explicit lock, you must lock all of them at the same time because you cannot use any unlocked tables while you hold explicit locks. Also, you must lock all the tables with a single LOCK TABLES statement. LOCK TABLES releases…

JDBC

Question

You want to lock the three tables a, b and c, and issue the following statements:

mysql> LOCK TABLES a READ; mysql> LOCK TABLES b READ; mysql> LOCK TABLES c READ; Which tables are now locked?

Options

  • ATables a, b and c
  • BTable a only
  • CTable c only
  • DNone of the tables are locked

How the community answered

(50 responses)
  • A
    4% (2)
  • B
    10% (5)
  • C
    80% (40)
  • D
    6% (3)

Explanation

If you need to use multiple tables while holding an explicit lock, you must lock all of them at the same time because you cannot use any unlocked tables while you hold explicit locks. Also, you must lock all the tables with a single LOCK TABLES statement. LOCK TABLES releases any locks that you already hold, so you cannot issue it multiple times to acquire multiple locks.

Topics

#LOCK TABLES#lock replacement#sequential lock statements#MySQL

Community Discussion

No community discussion yet for this question.

Full 1Z0-873 Practice