I have an IDbTransaction in a using statement, but I'm not sure that it will be rolled back if an exception is used in the using statement. I know that the using statement will force the Dispose () call ... but does anyone know if this is true for Rollback ()?
Update: Also, I need to explicitly call Commit (), since I have below or will the usage of the using statement also be taken into account?
My code looks something like this:
using Microsoft.Practices.EnterpriseLibrary.Data; ... using(IDbConnection connection = DatabaseInstance.CreateConnection()) { connection.Open(); using(IDbTransaction transaction = connection.BeginTransaction()) {
c # using-statement transactions rollback
mezoid Mar 13 '09 at 6:32 2009-03-13 06:32
source share