Due to connection pool reusing connection. I was told that I should be explicitly setting the isolation level before running my query.
The only way I found to set the isolation level is BeginTransaction(isolationLevel)
.
However I want to run a bunch inserts without having them wrapped inside a transaction (running them as auto commit transaction) to avoid deadlock. And i dont want to run them as Serializable
or Read Uncommitted
just because the previous connection was set to that level.
for example I want to run
command.CommandText = "INSERT INTO ....; INSERT INTO ....; INSERT INTO ....;"
command.ExecuteNoneQuery();
Whats the best way to do this?