Skip to main content
EnglandComputer ScienceSyllabus dot point

How does a database stay correct when many users change it at once?

Transaction processing and the ACID properties (atomicity, consistency, isolation, durability), record locking and serialisation to manage concurrent access, and redundancy through commitment ordering and backups.

An OCR H446 answer on transaction processing and managing concurrent access: the ACID properties (atomicity, consistency, isolation, durability), record locking and serialisation to prevent conflicting updates, and redundancy through commitment ordering and backups.

Generated by Claude Opus 4.813 min answer

Reviewed by: AI editorial process; not yet individually human-reviewed

Have a quick question? Jump to the Q&A page

Jump to a section
  1. What this dot point is asking
  2. The answer
  3. Examples in context
  4. Try this

What this dot point is asking

OCR wants the four ACID properties of a reliable transaction, how record locking and serialisation manage concurrent access (and the lost-update problem and deadlock), and how redundancy through commitment ordering and backups protects data. Expect a long question applying ACID and locking to a real system.

The answer

The ACID properties

Concurrent access and record locking

Serialisation and redundancy

Examples in context

Banking transfers rely on atomicity (no money lost between accounts) and durability (a committed transfer survives a crash). Ticketing and stock systems use record locking to stop overselling the last item. Airline booking systems serialise seat reservations so two passengers never get the same seat. Nightly backups and transaction logs let a bank recover after a failure. OCR links this to concurrent processing in Component 02 and to the normalised, SQL-driven databases in the rest of section 1.3.

Try this

Q1. State what the 'A' and the 'D' in ACID stand for and what each guarantees. [2 marks]

  • Cue. Atomicity: a transaction is all-or-nothing (fully done or rolled back). Durability: once committed, changes are permanent and survive a crash.

Q2. Explain why record locking can lead to deadlock. [2 marks]

  • Cue. Two transactions can each hold a lock the other needs and both wait indefinitely; this is resolved by an ordering of locks or by timeouts.

Q3. State one method of providing redundancy to protect database data. [1 mark]

  • Cue. Regular backups (or transaction logs / ordered commitment) so data can be restored after loss or failure.

Exam-style practice questions

Practice questions written in the style of OCR exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.

OCR 20208 marksAn online banking database is updated by thousands of users at once. Discuss how the ACID properties and record locking keep the data correct.
Show worked answer →

Levels-of-response question; reward the four ACID properties applied plus locking.

Atomicity: a transaction is all-or-nothing, so a transfer that debits one account and credits another either completes fully or is rolled back, never leaving money debited but not credited. Consistency: a transaction takes the database from one valid state to another, preserving rules such as non-negative balances. Isolation: concurrent transactions do not interfere; each behaves as if it ran alone, so a half-finished transfer is not seen by others. Durability: once committed, changes survive a crash or power loss (written to permanent storage).

Record locking supports isolation: while one transaction is updating a record it locks it so others must wait, preventing the lost-update problem where two simultaneous edits overwrite each other. The drawback is that careless locking can cause deadlock, so an ordering or timeout is used. Top marks need all four ACID properties applied to the banking context plus locking explained.

OCR 20224 marksExplain the 'lost update' problem that can occur with concurrent access, and explain how record locking prevents it.
Show worked answer →

Lost update (2 marks): two transactions read the same record at the same time, each modifies its own copy and writes back; the second write overwrites the first, so one update is lost (for example two clerks both book the last seat, and one booking vanishes).

Record locking (2 marks): when a transaction begins updating a record it places a lock on it, so any other transaction must wait until the lock is released before it can read or write that record. This serialises access to the record, so the second transaction works from the already-updated value and no update is lost. Markers reward the read-modify-write overwrite for the problem and "lock forces others to wait" for the fix.

Related dot points

Sources & how we know this