Transaction
المعاملة (Transaction)
GLS-000094
Definition
A set of database operations that either all succeed or all fail — ensuring data stays consistent.
مجموعة من عمليات قاعدة البيانات إما تنجح كلها أو تفشل كلها — لضمان اتساق البيانات.
Why It Matters
Without transactions, two users creating content simultaneously could get the same canonical ID. Transactions prevent this race condition.
بدون المعاملات، مستخدمان يُنشئان محتوى في وقت واحد قد يحصلان على نفس المعرّف الأساسي. المعاملات تمنع هذا التعارض.
Full Definition
Example Usage
“The glossary seed route uses a transaction to safely increment the _counters/gls document and reserve unique canonicalIds like GLS-000042.”
“مسار بذر الغلوساري يستخدم معاملة لزيادة مستند _counters/gls بأمان وحجز canonicalIds فريدة مثل GLS-000042.”
AI Builder Tips
Avoid these mistakes when using Transaction:
Doing heavy async work inside a transaction (transactions should be fast)
Not handling transaction failures in your code
Sign in to unlock guided AI explanations from AI Teacher.
Generate a Prompt
Copy this prompt and use it directly with any AI model — no setup needed.
Help me build a project using Transaction. Explain: 1. What is Transaction and why it matters 2. The core architecture and required tools 3. Step-by-step implementation plan 4. Common mistakes to avoid: Doing heavy async work inside a transaction (transactions should be fast), Not handling transaction failures in your code 5. Best practices and production tips