My Application uses ADO.NET to make sql queries to a sql server database. The sql server default transaction level is set to read committed. The application is using the transaction isolation level repeatable read for all transactions. However, for some selects (and not all the time for the same selects) it appears the transaction isolation level is set to serializable. Is there any reason why this would happen and is there any way to enforce a given select to run at a given isolation level?

有帮助吗?

解决方案

Default isolation level for Transaction class in .NET is serializable. The isolation level is one of the properties of the connection that is not reset when the connection goes back to the pool after being disposed. This is why you're observing this.

Best practice for .NET applications using Transaction class is to set isolation level explicitly.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top