home / skills / pluginagentmarketplace / custom-plugin-sql / transactions
This skill helps you implement ACID transactions, manage isolation levels, and handle concurrency in SQL backed applications.
npx playbooks add skill pluginagentmarketplace/custom-plugin-sql --skill transactionsReview the files below or copy the command above to add this skill to your agents.
---
name: transactions
description: Database transactions, ACID properties, and concurrency control
sasmp_version: "1.3.0"
bonded_agent: 01-sql-fundamentals
bond_type: PRIMARY_BOND
---
# Database Transactions Skill
## Overview
Understand and implement database transactions with ACID properties and proper concurrency control.
## Topics Covered
### ACID Properties
- Atomicity
- Consistency
- Isolation
- Durability
- Trade-offs
### Isolation Levels
- Read uncommitted
- Read committed
- Repeatable read
- Serializable
- Snapshot isolation
### Concurrency
- Locking mechanisms
- Deadlock handling
- Optimistic locking
- MVCC concepts
- Lock monitoring
### Transaction Patterns
- Savepoints
- Nested transactions
- Distributed transactions
- Two-phase commit
- Saga pattern
## Prerequisites
- SQL fundamentals
- Database concepts
## Learning Outcomes
- Implement ACID transactions
- Choose isolation levels
- Handle deadlocks
- Design concurrent systems
This skill teaches database transactions with a focus on ACID properties, isolation levels, and practical concurrency control. It covers patterns and tools for building reliable, consistent data operations in single-node and distributed systems. You will learn trade-offs and design choices that affect performance and correctness.
The skill inspects common transaction scenarios and explains how atomicity, consistency, isolation, and durability are achieved in SQL databases. It breaks down isolation levels, locking strategies, MVCC behavior, and failure-handling patterns such as two-phase commit and sagas. Concrete examples and patterns show how to apply savepoints, nested transactions, and deadlock recovery in application code.
When should I use serializable isolation?
Use serializable when strict correctness is mandatory and anomalies cannot be tolerated; expect reduced concurrency and potential performance impact.
How do I handle deadlocks in production?
Detect and log deadlock incidents, ensure transactions are short, order resource acquisition consistently, and implement retry logic with backoff.
When are sagas preferable to two-phase commit?
Use sagas for long-running, loosely coupled distributed workflows where blocking coordinator-based protocols would be impractical; implement compensating transactions for failure recovery.