Using for IDbConnection/IDbTransaction safe to use?

前端 未结 2 1081
臣服心动
臣服心动 2021-02-08 09:55

While my assumption may seem to sound subjective, after some research, I found that it\'s not uncommon to find developers who favour a dummy Try/Catch instead of us

2条回答
  •  孤独总比滥情好
    2021-02-08 10:49

    What you're seeing is developers coding according to the documentation (a "Good Thing"). The base class DbTransaction (used for most data providers' transaction implementations) states clearly in its documentation:

    Dispose should rollback the transaction. However, the behavior of Dispose is provider specific, and should not replace calling Rollback.

提交回复
热议问题