Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(client): Implement isolation levels for batched transactions #15362

Merged
merged 1 commit into from Sep 20, 2022

Conversation

SevInf
Copy link
Contributor

@SevInf SevInf commented Sep 16, 2022

Engines part: prisma/prisma-engines#3199

Batch $transaction call will now receive optional options
objects with isolationLevel property, allowing to pick any level,
supporting by current transaction. Internally, refactors a bunch of
things about the way transaction info is stored in PrismaPromise,
Request and InternalRequest types.

  • All transaction-related properties are now grouped under transaction
    key. Distiction between iTx and batch transaction is done explcitly
    via discriminated union type.

  • runInTransaction property is removed. Empty transaction field now
    means that request is not running in transaction.

    For testing we are checking that engine correctly generates corresponding SQL.
    Properly testing different isolation level effects would be very
    difficult, especially in case of batch transactions, where we can not
    execute any code between the queries.

Ref #9678

@SevInf SevInf added this to the 4.4.0 milestone Sep 16, 2022
packages/client/package.json Outdated Show resolved Hide resolved
@SevInf
Copy link
Contributor Author

SevInf commented Sep 16, 2022

Tests are failing due to #15360

@SevInf SevInf marked this pull request as ready for review September 16, 2022 15:36
@SevInf SevInf requested a review from a team September 16, 2022 15:36
@SevInf SevInf requested review from millsp and removed request for a team September 16, 2022 15:36
@millsp millsp changed the title feat(client): Implement isolation levels for bathc transactions feat(client): Implement isolation levels for batched transactions Sep 16, 2022
@SevInf
Copy link
Contributor Author

SevInf commented Sep 19, 2022

@millsp I beleive it can now go for additional round of reviews, while I am working on engines

@SevInf SevInf requested a review from millsp September 19, 2022 12:46
Copy link
Member

@millsp millsp left a comment

Choose a reason for hiding this comment

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

Looks good to go! Thanks for adding the missing tests

@SevInf SevInf force-pushed the batch-isolation-level branch 5 times, most recently from 9e86e88 to fec107c Compare September 20, 2022 13:13
Engines part: prisma/prisma-engines#3199

Batch `$transaction` call will now receive optional options
objects with `isolationLevel` property, allowing to pick any level,
supporting by current transaction. Internally, refactors a bunch of
things about the way transaction info is stored in `PrismaPromise`,
`Request` and `InternalRequest` types.

- All transaction-related properties are now grouped under `transaction`
  key. Distiction between iTx and batch transaction is done explcitly
  via discriminated union type.
- `runInTransaction` property is removed from everywhere expcept
  middleware public APIs. `transaction` field now indicates that the
  request should run in transaction.

For testing we are checking that engine correctly generates corresponding SQL.
Properly testing different isolation level effects would be very
difficult, especially in case of batch transactions, where we can not
execute any code between the queries.

Ref #9678
@SevInf SevInf merged commit a3a2177 into main Sep 20, 2022
@SevInf SevInf deleted the batch-isolation-level branch September 20, 2022 14:42
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.

None yet

2 participants