[Sqlalchemy-tickets] Issue #3357: Connection.get_isolation_level() returns incorrect isolation leve
Brought to you by:
zzzeek
|
From: Timothy C. <iss...@bi...> - 2015-04-05 06:10:13
|
New issue 3357: Connection.get_isolation_level() returns incorrect isolation level for autocommit on psycopg2 https://bitbucket.org/zzzeek/sqlalchemy/issue/3357/connectionget_isolation_level-returns Timothy Cardenas: Simply create a engine with isolation_level set to autocommit, connect, and compare the return value from get_isolation_level from the value returned from the psycopg2 connection. They do not match. Example: ``` #!python url='postgresql+psycopg2://me:pass@host/db' engine = create_engine( url, encoding='utf8', pool_size=5, poolclass=QueuePool, isolation_level="AUTOCOMMIT" ) with engine.connect() as connection: print(connection.get_isolation_level()) # => READ COMMITED print(connection.connection.isolation_level) # => 0 (psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT) ``` Responsible: zzzeek |