IDbTransaction and IDisposable
MSDN do not define what Dispose
should do for transactions. So my guess is that ADO.NET drivers do not do anything s开发者_如何学Gopecial in it (other than cleaning up resources)?
It would be lovely if it called Rollback
if neither of Commit
and Rollback
has not been called before Dispose
.
The behavior (although this may not be officially documented) is to Rollback() if a successful call to Commit() has not occurred prior to the Dispose() being called. This can be verified by disassembling the .NET System.Data assemblies.
精彩评论