Static snapshot cursors Which cursor type shows the data exactly as it was when the cursor opened, regardless of subsequent inserts, updates, or deletes by other sessions?

Difficulty: Easy

Correct Answer: Static cursor.

Explanation:


Introduction / Context:
Cursors differ in whether they present a live view of underlying tables or a stable snapshot. Static cursors are designed for repeatable, predictable reads without mid-scan surprises from concurrent activity.


Given Data / Assumptions:

  • The cursor should not reflect concurrent commits after it opens.
  • We compare static, keyset, dynamic, and navigation-focused types.


Concept / Approach:

A static cursor materializes the result set when opened. Because the data is copied or fixed at open time, later changes are not visible. This behavior simplifies application logic that expects identical results when re-reading within the same cursor session.


Step-by-Step Solution:

1) Identify snapshot behavior as the key requirement.2) Static cursor matches snapshot semantics.3) Keyset fixes membership but refreshes values for those keys—still not a full snapshot.4) Dynamic reflects all concurrent changes and therefore is not static.5) Forward-only speaks to direction, not visibility.


Verification / Alternative check:

DBMS manuals describe static cursors as insensitive to changes after open, confirming snapshot semantics and predictable iteration behavior.


Why Other Options Are Wrong:

  • Forward-only: direction only.
  • Keyset: fixed membership, but values can change.
  • Dynamic: fully reflects new commits—opposite of snapshot.
  • Scrollable dynamic: still dynamic in visibility.


Common Pitfalls:

  • Assuming keyset is identical to static; keyset can still show updates for existing keys.
  • Using dynamic when a stable audit-like iteration is required.


Final Answer:

Static cursor.

More Questions from Managing Multiuser Databases

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion