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

V5: Repeatable read isolation doesn't work as expected #1006

Open
mkevison opened this issue Feb 10, 2024 · 0 comments
Open

V5: Repeatable read isolation doesn't work as expected #1006

mkevison opened this issue Feb 10, 2024 · 0 comments
Assignees

Comments

@mkevison
Copy link

mkevison commented Feb 10, 2024

Package version

5.9.0

Describe the bug

I'm running some tests with isolation in Postgres

I create a transaction with the isolation type repeatable read

const firstTransaction = await Database.connection(connection).transaction({
       isolationLevel: 'repeatable read',
})

After that, I perform a query using the newly created transaction.

Through a second transaction, before committing the firstTransaction, I read, update and commit the data read by the firstTransaction

After changes using the second transaction I update the same data again using the firstTransaction

What is expected is that the firstTransaction commit gives an error and that is not what is happening, the commit passes normally

I simulated this through two Postgres terminals and it worked as expected, the firstTransaction after reading and changing the data does not accept the commit if this data is changed by another transaction before its commit

Note: I am correctly using firstTransaction when reading and changing data

Reproduction repo

https://github.com/mkevison/repeatable-read

@thetutlage thetutlage self-assigned this Feb 16, 2024
@Julien-R44 Julien-R44 transferred this issue from adonisjs/core Feb 24, 2024
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

No branches or pull requests

2 participants