From 6882cb17e9eb56b137fa4c2ac2ba736aa286c35d Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 27 Mar 2011 20:50:47 -0400 Subject: [PATCH] - add a note about snapshot isolation [ticket:2078] --- lib/sqlalchemy/dialects/mssql/base.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lib/sqlalchemy/dialects/mssql/base.py b/lib/sqlalchemy/dialects/mssql/base.py index ae544584f4..16d9217853 100644 --- a/lib/sqlalchemy/dialects/mssql/base.py +++ b/lib/sqlalchemy/dialects/mssql/base.py @@ -141,6 +141,23 @@ Declarative form:: This option can also be specified engine-wide using the ``implicit_returning=False`` argument on :func:`.create_engine`. +Enabling Snapshot Isolation +--------------------------- + +Not necessarily specific to SQLAlchemy, SQL Server has a default transaction +isolation mode that locks entire tables, and causes even mildly concurrent +applications to have long held locks and frequent deadlocks. +Enabling snapshot isolation for the database as a whole is recommended +for modern levels of concurrency support. This is accomplished via the +following ALTER DATABASE commands executed at the SQL prompt:: + + ALTER DATABASE MyDatabase SET ALLOW_SNAPSHOT_ISOLATION ON + + ALTER DATABASE MyDatabase SET READ_COMMITTED_SNAPSHOT ON + +Background on SQL Server snapshot isolation is available at +http://msdn.microsoft.com/en-us/library/ms175095.aspx. + Known Issues ------------ -- 2.47.2