If we don't do anything about it, the repositories will execute each query as a standalone individual query. Since there are operations that execute multiple database queries that affect multiple tables and rows, we'll want to "group" those standalone queries together so we can revert all changes in case an error happens. That's called "atomicity" - either all queries get executed successfully or none of them. In this video we'll see how we can achieve atomicity in the repository pattern in JavaScript.
🔗 Links:
👉 GitHub Repo: github.com/nikolovlazar/nextjs-clean-architecture
👉 Demo: next-clean-arch.vercel.app/
👉 Clean Architecture video: • Clean Architecture in Next.js: A Complete ...
--
🤝 Become a friend of the channel! Start your membership today and get extra benefits: youtube.com/channel/UCTexaJMnN_Pv6TVueQ61-oQ/join
💬 A bunch of us are hanging out at discord.creatures.sh/. Join us!
🐦 Find me on the bird app: twitter.com/NikolovLazar
🎥 What I use for coding and making videos: nikolovlazar.com/uses
--
Chapters:
00:00 - Intro
00:19 - Atomic Repositories
01:51 - Demo & Problem Statement
04:04 - Database Transactions
05:18 - Transactions in Clean Architecture
05:43 - Transaction Manager Service
06:50 - Using the service
09:37 - Transaction Trace View
10:52 - Savepoints
11:45 - Repository
コメント