Skip to content

Track and join pending database transaction when using transactWithRetry#9398

Open
isoos wants to merge 1 commit into
dart-lang:masterfrom
isoos:db-transaction
Open

Track and join pending database transaction when using transactWithRetry#9398
isoos wants to merge 1 commit into
dart-lang:masterfrom
isoos:db-transaction

Conversation

@isoos
Copy link
Copy Markdown
Collaborator

@isoos isoos commented May 18, 2026

Note: typed_sql (or specifically the postgresql driver) doesn't support re-entrant calling of db.transact(). With this change we don't force-start a new transaction, just use the outer one (same logic as with joining the outermost retry block).

@isoos isoos requested review from jonasfj and sigurdm May 18, 2026 14:06
@jonasfj
Copy link
Copy Markdown
Member

jonasfj commented May 21, 2026

Note: typed_sql (or specifically the postgresql driver) doesn't support re-entrant calling of db.transact(). With this change we don't force-start a new transaction, just use the outer one (same logic as with joining the outermost retry block).

I think it's only concurrent nested subtransactions that disallowed.

@jonasfj
Copy link
Copy Markdown
Member

jonasfj commented May 21, 2026

See also google/dart-neats#372

That said, one can argue that we probably don't need nested transactions, and instead just want single transactions.

Where in our code is this even relevant?

@isoos
Copy link
Copy Markdown
Collaborator Author

isoos commented May 27, 2026

Note: this may not be needed after all. Though, we could use this to detect re-entrant transaction calls, which we probably don't want, and maybe block them?

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