Couple of questions on dm_exec_sessions. When I run the query
select * from sys.dm_exec_sessions
it shows me among other columns a status and a transaction_isolation_level column.
It is my understanding that sys.dm_exec_sessions returns a row per authenticated session. In my understanding several queries/transactions can be run using this session.
-
What is the meaning of
transaction_isolation_levelthat is returned per session? Is it the isolation level of the last transaction that was run on the database using that connection? -
There are some (a couple) sessions that have a status of sleeping. What does that mean? Should we be worried about this? Are these transactions from the web server that have failed to rollback?
This is incorrect. You will always be able to execute at most one query and have at most one user active transaction in a session, never more than one of either.
A connection can have multiple sessions, but that is a different story. sys.dm_exec_connections
If you discover SERIALIZABLE sessions and you wonder why, then remember that using new TransactionScope() Is Considered Harmful