diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2017-01-26 16:54:02 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2017-01-26 16:54:02 -0500 |
| commit | 3757c0cdfb1c5078c8829abe3f6a995126de8ce6 (patch) | |
| tree | 6022d2ec9e243aed0837136fb2c63d474c00c816 /lib/sqlalchemy | |
| parent | a24801ae8de469f1e78bdb0c02b28de263c2310e (diff) | |
| download | sqlalchemy-3757c0cdfb1c5078c8829abe3f6a995126de8ce6.tar.gz | |
Don't check isolation level prior to SQL Server 2005
Added a version check to the "get_isolation_level" feature, which is
invoked upon first connect, so that it skips for SQL Server version
2000, as the necessary system view is not available prior to SQL Server
2005.
Change-Id: If4f860513f0aae6625803f449714aedfc5075f57
Fixes: #3898
Diffstat (limited to 'lib/sqlalchemy')
| -rw-r--r-- | lib/sqlalchemy/dialects/mssql/base.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/sqlalchemy/dialects/mssql/base.py b/lib/sqlalchemy/dialects/mssql/base.py index 3e16e6e35..6975754c6 100644 --- a/lib/sqlalchemy/dialects/mssql/base.py +++ b/lib/sqlalchemy/dialects/mssql/base.py @@ -1685,6 +1685,10 @@ class MSDialect(default.DefaultDialect): cursor.close() def get_isolation_level(self, connection): + if self.server_version_info < MS_2005_VERSION: + raise NotImplementedError( + "Can't fetch isolation level prior to SQL Server 2005") + cursor = connection.cursor() cursor.execute(""" SELECT CASE transaction_isolation_level |
