microsoft / mssql-django

The Microsoft Django backend for SQL Server provides a connectivity layer for Django on SQL Server or Azure SQL DB.
Other
324 stars 108 forks source link

Strange isolation level being set to "read committed" #44

Open variable opened 3 years ago

variable commented 3 years ago

I asked the same question on the old repo, but received no answer, so moved here:

"mssql": {
           "ENGINE": "sql_server.pyodbc",
         # "ENGINE": "mssql",
           "NAME": "...",
           "USER": "...",
           "PASSWORD": "....",
           "OPTIONS": {
                "dsn": "...",
                "initial_state": {
                    "quoted_identifier": "on",
                    "concat_null_yields_null": "on",
                    "ansi_warnings": "on",
                    "ansi_nulls": "on",
                    "ansi_padding": "on",
                    "implicit_transactions": "off"
                },
                "extra_params": "tds_version=7.3",
                "isolation_level": "READ UNCOMMITTED"
           },
          "TEST": {"MIRROR": "default"}
        }

I have the following settings with "isolation_level" set to `READ UNCOMMITTED", but every now and then we have query stuck with isolation level set to "READ COMMITTED", anyone having similar issue?

absci commented 3 years ago

https://github.com/microsoft/mssql-django/blob/219c8f76bcd3ad981c4bc8abd9e6a574cf802e0e/mssql/base.py#L372-L374 The isolation_level is set in base.py. I didn't experience any similar issues but feel free to update or open PR if you found any bugs.

variable commented 3 years ago

Yeah I have been through that file, I also added print statements in that file to log isolation levels, it seems fine but every now and then our MS guy saying some queries were executed in read committed level.