Does SqlTransaction need to have Dispose called?

后端 未结 3 618
情深已故
情深已故 2020-12-19 04:42

Do I need to call dispose in the finally block for SqlTransaction? Pretend the developer didnt use USING anywhere, and just try/catch.

SqlTransaction sqlTra         


        
3条回答
  •  死守一世寂寞
    2020-12-19 05:39

    I think you can just close connection. I checked the code of BCL -- seems like connections takes care of its transaction -- no need to close it explicitly.

提交回复
热议问题