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

Transaction Isolation Level #88

Open
repomaa opened this issue Aug 1, 2018 · 1 comment
Open

Transaction Isolation Level #88

repomaa opened this issue Aug 1, 2018 · 1 comment

Comments

@repomaa
Copy link

repomaa commented Aug 1, 2018

I'm missing support for setting the transaction isolation level. Preferably directly from Connection#transaction. It could be an optional enum type argument and the default should be set in the individual implementations since the defaults differ across mysql and postgres at least. In sql standard it is SERIALIZABLE but in postgres it's READ COMMITTED

@jgaskins
Copy link
Contributor

I was looking into this and realized that this may require special handling inside of the various drivers because they all seem to handle it differently. For example

DB Query syntax
Postgres BEGIN TRANSACTION ISOLATION LEVEL #{level};
MySQL SET TRANSACTION ISOLATION LEVEL #{level}; BEGIN;
SQLite all transactions are SERIALIZABLE

I don't know why MySQL requires a separate SET TRANSACTION command to use non-default isolation levels, but START TRANSACTION doesn't seem to support it. This means that the COMMIT would likely need to then reset the transaction isolation level back to the default.

Just some things to keep in mind as this feature is being developed or reviewed.

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