Findev wrote:
Is it safe to skip the try-catch and just call the .Commit() as the last statement in the using block?
That's correct. The try-catch it's recommended anyway to manage possible errors (concurrency, timeouts, DB validation errors, etc). However a using block is recommended at least.
Findev wrote:
Quickly glanced into adapter's Dispose, it seems it calls .Rollback() if there's an active transaction.
Correct. This is also mentioned in the documentation:
First a DataAccessAdapter object is created and a transaction is explicitly started. As soon as you start the transaction, a database connection is open and usable. It's best practice to embed the usage of a transaction in a try/catch/finally statement as it is done in the example above, or a using block. This ensures that if something fails during the usage of the transaction, everything is rolled back or, at the end, everything is committed correctly. A** DataAccessAdapter instance will rollback an open transaction when it's disposed**.