Will a using statement rollback a database transaction if an error occurs?

前端 未结 3 1807
别跟我提以往
别跟我提以往 2020-11-30 04:46

I\'ve got an IDbTransaction in a using statement but I\'m unsure if it will be rolled back if an exception is thrown in a using statement. I know that a using statement will

3条回答
  •  清歌不尽
    2020-11-30 05:05

    I believe that if there's an exception such that Commit() was never called, then the transaction will automatically rollback.

提交回复
热议问题