Skip to content

Specify aggregate and event database insertion order#469

Merged
erikrozendaal merged 4 commits intomasterfrom
specify-aggregate-and-event-insertion-order
May 12, 2025
Merged

Specify aggregate and event database insertion order#469
erikrozendaal merged 4 commits intomasterfrom
specify-aggregate-and-event-insertion-order

Conversation

@erikrozendaal
Copy link
Copy Markdown
Member

When inserting multiple rows it is important that all inserts happen in a consistent order, otherwise multiple concurrent transactions can deadlock.

Also ensure newly inserted events have a correct sequence number so that a primary key constraint violation is raised when multiple concurrent transactions update the same aggregate, which will result in a Sequent optimistic locking error.

When inserting multiple rows it is important that all inserts happen
in a consistent order, otherwise multiple concurrent transactions can
deadlock.

Also ensure newly inserted events have a correct sequence number so
that a primary key constraint violation is raised when multiple
concurrent transactions update the same aggregate, which will result
in a Sequent optimistic locking error.
@erikrozendaal erikrozendaal requested review from lvonk and werdlerk May 12, 2025 12:07
Copy link
Copy Markdown
Member

@lvonk lvonk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@erikrozendaal erikrozendaal merged commit 625f73b into master May 12, 2025
5 checks passed
@erikrozendaal erikrozendaal deleted the specify-aggregate-and-event-insertion-order branch May 12, 2025 14:26
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.

2 participants