Transaction management

From aj-geddes/useful-ai-prompts · View interactive version

Transaction management is an AI agent skill from the GitHub repository aj-geddes/useful-ai-prompts. Manage database transactions for data consistency. Use when implementing ACID compliance, handling concurrency, or managing transaction isolation levels.

How to use this skill

Skill file

Transaction Management

Table of Contents

Overview

Implement robust transaction management with ACID compliance, concurrency control, and error handling. Covers isolation levels, locking strategies, and deadlock resolution.

When to Use

Quick Start

Simple Transaction:

-- Start transaction
BEGIN;

-- Multiple statements
UPDATE accounts SET balance = balance - 100 WHERE id = 1;
UPDATE accounts SET balance = balance + 100 WHERE id = 2;

-- Commit changes
COMMIT;

-- Or rollback
ROLLBACK;

Reference Guides

Detailed implementations in the references/ directory:

| Guide | Contents |

|---|---|

| PostgreSQL Transactions | PostgreSQL Transactions |

| MySQL Transactions | MySQL Transactions |

| PostgreSQL Isolation Levels | PostgreSQL Isolation Levels |

| MySQL Isolation Levels | MySQL Isolation Levels |

| PostgreSQL Explicit Locking | PostgreSQL Explicit Locking |

| MySQL Locking | MySQL Locking |

| Deadlock Prevention | PostgreSQL - Deadlock Detection: |

Best Practices

✅ DO

❌ DON'T

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.