ADO.NET zombie transaction bug? How to ensure that commands will not be executed on implicit transac
Posted
by TN
on Stack Overflow
See other posts from Stack Overflow
or by TN
Published on 2010-06-07T14:33:05Z
Indexed on
2010/06/07
16:12 UTC
Read the original article
Hit count: 360
e.g. When deadlock occurs, following SQL commands are successfully executed, even if they have assigned SQL transaction that is after rollback. It seems, it is caused by a new implicit transaction that is created on SQL Server.
Someone could expect that ADO.NET would throw an exception that the commands are being executed on a zombie transaction. However, such exception is not thrown. (I think this is a bug in ASP.NET.) Moreover, because of zombie transaction the final Dispose()
silently ignores the rollback.
Any ideas, how can I ensure that nobody can execute commands on implicit transaction?
Or, how to check that transaction is zombie? I found that Commit()
and Rollback()
check for zombie transaction, however I can call them for a test:)
I also found that also reading IsolationLevel will do the check, but I am not sure whether simple calling transaction.IsolationLevel.ToString();
will not be removed by a future optimizer. Or do you know any other safe way invoke a getter (without using reflection or IL emitting)?
© Stack Overflow or respective owner