Persistence and Concurrency in Applications

  1. Beginning, Committing, and Rolling Back a Transaction

    A database transaction groups work under a boundary whose changes are committed together or rolled back under the database's rules.

    Undergraduate
  2. Autocommit and Multi-Statement Work

    Autocommit typically gives each ordinary statement its own transaction when no explicit transaction is active. A multi-step promise often needs a deliberate boundary.

    Undergraduate
  3. A Savepoint Inside a Transaction

    A savepoint marks a position an application can roll back to while keeping earlier work inside the same uncommitted transaction.

    Undergraduate
  4. Reading Committed State from Another Transaction

    A database's isolation rules determine which other writes a query can observe, including whether they must have committed.

    Undergraduate
  5. Choosing a Consistent Read Snapshot for a Report

    A report with several queries may need all observations to refer to one database snapshot. Select an isolation mode or query shape that provides it.

    Undergraduate
  6. A Read–Modify–Write Sequence and Lost Updates

    Separate reads and writes can cause concurrent workers to overwrite each other's changes if the operation lacks a suitable coordination rule.

    Undergraduate
  7. Updating Only the Version Previously Observed

    A conditional update can require both the row identity and the previously observed version. This makes an intervening edit observable to the caller.

    Undergraduate
  8. Locking a Row Before a Dependent Update

    A transaction can use a supported row lock when it must make a decision from a row and protect that decision while changing dependent state.

    Undergraduate
  9. Taking Locks in a Consistent Order

    Transactions accessing multiple resources can reduce circular waits by acquiring shared types of locks in a consistent order where their design permits.

    Undergraduate
  10. Retrying a Transaction from Its Beginning

    Some concurrency failures mean the whole transaction must be retried. A retry should repeat the reads and decisions belonging to that transaction.

    Undergraduate
  11. Recording a Repeatable Request Identity

    A stable request ID can let a transaction recognize and reuse the result of an ordinary repeated submission under an explicit policy.

    Undergraduate
  12. Saving Data and a Notification Intent Together

    A database transaction can persist a state change and an event record describing work another process should deliver later.

    Undergraduate
  13. Adding an Index for a Query Pattern

    An index can reduce access work for selected queries. It also adds storage and maintenance for writes.

    Undergraduate
  14. Using Ordered Lookup to Answer a Range Query

    An index with compatible ordering can make it possible to find the beginning of a range and scan relevant entries.

    Undergraduate
  15. Choosing Returned Columns for an Operational Query

    The columns a query returns can affect data transfer, object construction, and which access paths are useful.

    Undergraduate
  16. Enforcing Uniqueness Across Concurrent Inserts

    Checking for an existing row before inserting one can be useful feedback. Durable uniqueness needs coordination at the storage boundary.

    Undergraduate
  17. Resolving a Conflict During an Insert

    A database may offer an operation that handles a conflicting unique key by skipping or applying a defined update, depending on syntax and policy.

    Undergraduate
  18. Keeping External Work Out of a Long Transaction

    A short transaction can record a decision and allow slow external work to occur afterward, provided the intended workflow accounts for failures.

    Undergraduate
  19. Handling a Failed Transaction Before Continuing

    After a statement failure, the transaction may need rollback before further ordinary work under the database's rules.

    Undergraduate
  20. Committing State Before Rendering a Success Result

    A response should represent the final state promised to callers. A provisional write inside one transaction does not yet establish that state.

    Undergraduate
  21. Checkpointing a Batched Database Import

    A batched import can record its last fully committed input position so a resumed run does not skip or duplicate work.

    Undergraduate
  22. Whole Import and Batch-Level Commit Contracts

    An import can require all input to commit together or allow completed batches to survive a later error. Each choice changes what success and recovery mean.

    Undergraduate
  23. Reading Your Own Edits Before Publication

    Within a transaction, reads can see that transaction's own changes under ordinary database rules while other transactions follow their visibility contract.

    Undergraduate
  24. Reading Data After an Asynchronous Write Request

    A request can be accepted before work is committed. Specify which outcome proves the record is readable under the intended consistency guarantees.

    Undergraduate
  25. Omitted and Null Fields in a Partial Update

    A partial update can interpret omitted fields as unchanged and explicit null as a deliberate clear when permitted by the schema.

    Undergraduate
  26. Claiming Work from a Shared Database Queue

    A shared queue needs an atomic claim decision so two workers do not both treat one pending row as their exclusive work.

    Undergraduate
  27. Keeping a Stable Public Address Across Revisions

    A durable resource can have one stable public address and several stored revisions, with application state selecting which revision is shown.

    Undergraduate
  28. Effective Time and Recorded Time

    An event can become effective at one time and be recorded by a system later. Store both when readers need to answer both questions.

    Undergraduate
  29. A Deterministic Test for Concurrent Database Behavior

    A useful concurrency test coordinates workers at known points instead of assuming their operations overlap based on timing alone.

    Undergraduate
  30. Using Counts and Sample Reads to Check Persisted State

    A consistency check can combine totals, stable identities, relationships, and a known example to verify an operation's effects.

    Undergraduate