-
Notifications
You must be signed in to change notification settings - Fork 2
Dialect: Add methods concerned with isolation levels as no-ops #217
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
base: main
Are you sure you want to change the base?
Conversation
def get_isolation_level_values(self, dbapi_conn): | ||
return () | ||
|
||
def set_isolation_level(self, dbapi_connection, level): | ||
pass | ||
|
||
def get_isolation_level(self, dbapi_connection): | ||
return "NONE" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any recommendations?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consulting Wikipedia and the SQLAlchemy documentation, READ UNCOMMITTED
might be the right choice for CrateDB?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typical PostgreSQL drivers in Java (JDBC) and Python offer the same quartet, and Apache Spark additionally seems to provide NONE
.
So, I guess using READ UNCOMMITTED
as the default and single valid choice for CrateDB is the right way to resolve the situation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like specifically for SQLAlchemy, AUTOCOMMIT
seems to be more appropriate.
SQLAlchemy treats the concept of “autocommit” like any other isolation level; in that it is an isolation level that loses not only “read committed” but also loses atomicity. [...] This usually means that the typical DBAPI behavior of emitting
BEGIN
to the database automatically no longer occurs.
-- https://docs.sqlalchemy.org/en/20/core/connections.html#dbapi-autocommit
About
This was needed for unlocking mcp-alchemy, because it called
set_isolation_level()
on the dialect instance.References
Backlog