I want to apply some sql-session level settings for certain processes in my c#
app.
For instance, I want to set DEADLOCK_PRIORITY
for some background processes to LOW
.
The questions are:
If I open a new sql connection, does that start a new sql-session?
Will the sql-session live until the connection is closed? If I apply my settings right after the
SqlConnection
is opened, will they be valid for all queries executed in context of that sameSqlConnection
?What about connection pooling? Is this possible that my
SET DEADLOCK_PRIORITY LOW
setting will be reused by other processes in my system (which I don't want to) because theSqlConnection
is not actually closed ( asp.net connection pooling decides to reuse it).
Thank you!