Description
When EnlistInAmbientTransaction
is called in wire-up, the default isolation level of the SQL Persistence for SQL Server is changed from the database default of READ COMMITTED
to SERIALIZABLE
. This can and probably should be fixed directly in NEventStore (NEventStore/NEventStore#414), but if it isn't, a workaround should be added in NEventStore.Persistence.SQL because the SQL persistence doesn't work as nicely with the SERIALIZABLE
isolation level (we experienced database-level deadlocks with multiple readers/writers), and it's also much less efficient.
Reason for the SERIALIZABLE
isolation level: If the TransactionScopeOption.Required
is used (via code in PersistenceWireup
) without specifying an isolation level, the TransactionScope
default isolation level of SERIALIZABLE
is used if there is no ambient transaction.