Skip to content

feat(database): implement global transaction middleware#377

Closed
mijinummi wants to merge 2 commits intoMindBlockLabs:mainfrom
mijinummi:feature/db-transaction-middleware
Closed

feat(database): implement global transaction middleware#377
mijinummi wants to merge 2 commits intoMindBlockLabs:mainfrom
mijinummi:feature/db-transaction-middleware

Conversation

@mijinummi
Copy link
Copy Markdown
Contributor

Database Transaction Middleware for Data Integrity (#322)

Overview

This PR introduces a global transaction middleware to ensure all database operations are atomic, consistent, isolated, and durable (ACID).

Changes

  • Added TransactionManager for TypeORM transaction handling
  • Implemented TransactionMiddleware to wrap requests in transactions
  • Added support for isolation levels (READ COMMITTED, REPEATABLE READ, SERIALIZABLE)
  • Implemented savepoints for nested transactions
  • Added rollback triggers for errors, validation failures, and timeouts
  • Integrated TransactionLogger for monitoring conflicts and rollbacks
  • Registered middleware globally in AppModule

Acceptance Criteria Met

  • ✅ Automatic transaction wrapping
  • ✅ Rollback on failed requests
  • ✅ Commit on success
  • ✅ Deadlock and timeout handling
  • ✅ Read-only transaction support
  • ✅ Consistency across multi-table operations
  • ✅ Logging and metrics for monitoring

Next Steps

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 26, 2026

@mijinummi Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Database Transaction Middleware for Data Integrity

2 participants