-
Notifications
You must be signed in to change notification settings - Fork 323
SQL Server Isolation Levels
Fabian Schmied edited this page Feb 18, 2022
·
4 revisions
Be sure to run NEventStore's MsSqlDialect queries in READ COMMITTED isolation level (which is NEventStore's default).
- With
SERIALIZABLE(possible, e.g., by enabling theEnlistInAmbientTransactionsoption and either creating serializableTransactionScopes, or not creating anyTransactionScopesat all, see also https://github.com/NEventStore/NEventStore/issues/414), the chance of deadlocks under high load is highly increased. - With
READ COMMITTED SNAPSHOT(this is a database option that NEventStore does not set by default), theGetFromAPI and theCommitPollingClientare broken because these APIs rely on blocking behavior while aCommitoperation is active. SinceREAD COMMITTED SNAPSHOTdisables the blocking behavior, commits can be skipped when using those APIs. See https://github.com/NEventStore/NEventStore.Persistence.SQL/issues/31 . - Due to the previous issue, you need to derive from
MsSqlDialectand addWITH (READCOMMITTEDLOCK)table hints if you want to use Azure SQL (because that database always uses theREAD COMMITTED SNAPSHOToption).