Reputation: 101166
MSDN do not define what Dispose
should do for transactions. So my guess is that ADO.NET drivers do not do anything special 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
.
Upvotes: 0
Views: 590
Reputation: 643
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.
Upvotes: 2