Dialect: Add methods concerned with isolation levels as no-ops#217
Dialect: Add methods concerned with isolation levels as no-ops#217
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.
Consulting Wikipedia and the SQLAlchemy documentation, READ UNCOMMITTED might be the right choice for CrateDB?
There was a problem hiding this comment.
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.
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
BEGINto 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