A database transaction groups related database operations into one unit of work with a shared commit or rollback outcome. Atomicity prevents partial writes from leaving sessions or indexes inconsistent. section 4.4.2 section 5.3.7
Production-oriented transaction patterns include:
- Insert every message in a session with one executemany call, update the session timestamp, and commit once so all messages succeed or none do. section 4.4.2
- Treat document replacement as one atomic sequence: delete old chunks, extract and chunk content, generate embeddings, and insert replacements. section 5.3.7
- Use a new index and switch traffic only after bulk re-ingestion completes when mixed parser versions would be unacceptable. section 5.3.7
Atomic document replacement
A document is re-ingested by deleting its previous chunks, extracting and chunking the new file, generating embeddings, and inserting the replacements. If embedding or storage fails, the transaction rolls the index back instead of leaving the document absent. section 5.3.7




















