nerdexam
Oracle

1Z0-908 · Question #52

You encountered an insufficient privilege error in the middle of a long transaction. The database administrator is informed and immediately grants the required privilege: GRANT UPDATE ON world.city…

The correct answer is B. Re-execute the failed statement in your transaction. In MySQL, GRANT statements take effect immediately - the privilege tables are updated at once, and no reconnection is required for the change to be recognized. Because the UPDATE privilege error caused the statement to fail (not the transaction to abort), the transaction…

Security

Question

You encountered an insufficient privilege error in the middle of a long transaction. The database administrator is informed and immediately grants the required privilege:

GRANT UPDATE ON world.city TO `user1'; How can you proceed with your transaction with the least interruption?

Options

  • ARoll back the transaction and start the transaction again in the same session.
  • BRe-execute the failed statement in your transaction.
  • CChange the default database and re-execute the failed statement in your transaction.
  • DClose the connection, reconnect, and start the transaction again.

How the community answered

(52 responses)
  • A
    4% (2)
  • B
    77% (40)
  • C
    12% (6)
  • D
    8% (4)

Explanation

In MySQL, GRANT statements take effect immediately - the privilege tables are updated at once, and no reconnection is required for the change to be recognized. Because the UPDATE privilege error caused the statement to fail (not the transaction to abort), the transaction remains open and valid; you simply re-execute the failed UPDATE and continue from where you left off with zero work lost.

Why the distractors are wrong:

  • A - Rolling back discards all prior work in the transaction, which is the opposite of "least interruption."
  • C - Changing the default database has no bearing on the privilege issue; the GRANT already applied to world.city specifically, so no schema switch is needed.
  • D - Closing the connection terminates the transaction entirely, forcing a full restart - the most disruptive option of all.

Memory tip: Think "GRANT = instant, no restart required." MySQL flushes privilege changes immediately on GRANT, unlike some other systems that require a FLUSH PRIVILEGES or reconnect - so a failed statement is just a retry, not a transaction restart.

Topics

#transaction recovery#privilege grants#session behavior#error handling

Community Discussion

No community discussion yet for this question.

Full 1Z0-908 Practice