[Sqlalchemy-tickets] Issue #3534: Set transaction isolation level for MSSQL? (zzzeek/sqlalchemy)
Brought to you by:
zzzeek
|
From: Denis S. <iss...@bi...> - 2015-09-17 10:54:29
|
New issue 3534: Set transaction isolation level for MSSQL? https://bitbucket.org/zzzeek/sqlalchemy/issues/3534/set-transaction-isolation-level-for-mssql Denis Stebunov: I'm trying to set transaction isolation level to READ UNCOMMITTED for connection to MSSQL 2012. If I specify it as a parameter to create_engine(), I get ``` ... File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/strategies.py", line 144, in create engineclass.__name__)) TypeError: Invalid argument(s) 'isolation_level' sent to create_engine(), using configuration MSDialect_pymssql/QueuePool/Engine. Please check that the keyword arguments are appropriate for this combination of components. ``` If I specify it as a parameter to sessionmaker(), I get ``` ... File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/interfaces.py", line 716, in set_isolation_level raise NotImplementedError() NotImplementedError ``` I tried it both with pyodbc and pymssql, and none of them worked. As a last resort I'm using `.with_hint(myTable, 'WITH (nolock)')` for my queries (this is equivalent to READ UNCOMMITTED at query level), but unfortunately it doesn't work with relationships loaded with joinedload - hint is ignored for relationships (but successfully applied to main table in the query). Any ideas? |