A-level Computer Science revision · Exchanging data

Transactions and ACID

The idea

A transaction is a single logical operation. ACID properties keep databases reliable: Atomicity (all or nothing), Consistency (rules are kept), Isolation (concurrent transactions do not interfere) and Durability (committed changes survive failures). Record locking prevents two users updating the same record at once. Redundancy (copies on separate systems) protects against failure.

  1. Name each ACID property and its meaning.
  2. Record locking stops lost updates.
  3. Watch for deadlock when two transactions wait for each other.

Watch out Atomicity means a transaction cannot be half-completed; it is fully done or fully rolled back.

See it worked

Worked example

A bank transfer takes money from one account but the system crashes before adding it to the other. Which property prevents loss?

  1. Either both steps happen or neither does.
  2. The partial change is rolled back.
  3. Atomicity.

Answer Atomicity

Your turn

Question 11 mark

Which ACID property ensures committed changes survive a power cut?

Choose one
Question 21 mark

What problem does record locking prevent?

Choose one
Question 32 marks

Explain deadlock in databases.

Write your answer, then see a model answer
  1. Describe the situation.
  2. Give the resolution.

Answer Two transactions each lock a record the other needs, so both wait forever; the DBMS must detect this and roll one back.

A-level Computer Science Pro, OCR H446

A-level Computer Science Pro

£119 once

Price rises to £199 on 1 January. Save £80 by joining before then.

At least 12 months of access

By paying you agree to our Terms and get access straight away, which ends your 14-day cancellation right.

No VAT is charged.

Independent practice for OCR A-level Computer Science (H446), not endorsed by OCR.

Privacy · Terms