Skip to content

Conversation

@abnegate
Copy link
Member

  • Remove inline adapter transactions
  • Add abstracted transactions functions to adapter + database
  • Wrap CRUD functions in transactions at the database layer
  • Allow getting document for update

All of this allows atomic updates. Now when updating a document, we can read the existing document including a FOR UPDATE clauses, which will apply a read lock on the row until we complete the update.

Doing this will resolve race conditions where parallel updates overwrite changes.

@abnegate abnegate merged commit 0b48921 into main Aug 21, 2024
@abnegate abnegate deleted the feat-atomic-updates branch August 21, 2024 08:11
abnegate added a commit that referenced this pull request Sep 12, 2024
Feat atomic updates
# Conflicts:
#	composer.json
#	composer.lock
#	src/Database/Adapter/MariaDB.php
#	src/Database/Adapter/Postgres.php
#	src/Database/Adapter/SQLite.php
#	src/Database/Database.php
#	tests/e2e/Adapter/Base.php
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.

3 participants