Skip to main content

Transactions and Error Handling

Understanding Transactions

0:00
LearnStep 1/2

Transaction Fundamentals

Database Transactions

ACID Properties

PropertyDescription
AtomicityAll or nothing - complete success or complete rollback
ConsistencyDatabase moves from one valid state to another
IsolationConcurrent transactions don't interfere
DurabilityCommitted changes persist even after crashes

Transaction Control in psycopg2

python

Autocommit Mode

python

Transaction Example: Bank Transfer

python