Domanda

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?

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top