jgauffin
jgauffin

Reputation: 101166

IDbTransaction and IDisposable

MSDN do not define what Disposeshould 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

Answers (1)

Daniel P. Bullington
Daniel P. Bullington

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

Related Questions