码迷,mamicode.com
首页 > 数据库 > 详细

I fullly understand why can not set "auto commit off" in sqlserver

时间:2020-02-16 20:26:25      阅读:111      评论:0      收藏:0      [点我收藏+]

标签:testing   why   acl   nap   roc   mis   xxx   import   llb   

This is xxxxx

Because MES guy mistaken , the data was wrong and made system error then. After that I plan to set "auto
commit off" in sqlserver as default. However, I totally understood why can not set "auto commit off" in sqlserver after testing.
The most important reason is "allow snapshot isolation". Our default options is "OFF". That options means "UNDO".
If the option is "ON", then we can do uncheck IMPLICIT_TRANSACTIONS to force MES guy to use commit or rollback on
each DML statement.
Unfortunately, default option is "False", which means if we want to uncheck IMPLICIT_TRANSACTIONS and use SQL as
oracle way. It definately make table lock.
MES guy usually with (nolock) at select SQL statement, That is duty read , It can read uncommitted data, which lowest isolaton
level. You may say, well let do as read commit and auto commit OFF.
But under allow snapshot isolation =OFF, that makes table lock and select options also be hold by uncommit DML.
I can safety use auto commit OFF by allow snapshot isolation =ON. But all instance will be slow down because of it.
Total in all, we will use safety procedure to execute DML.

Hi..xxxxx
As you mention “undo”, that is not “allow snapshot isolation” but “read committed snapshot”
So in my opinion, we must not turn “allow snapshot isolation” ON.
Supposing we do that, we would suffer from very slow transaction,
Because “allow snapshot isolation” is mixing two method, UNDO and with(nolock), so it make transaction cost more expensive.

I fullly understand why can not set "auto commit off" in sqlserver

标签:testing   why   acl   nap   roc   mis   xxx   import   llb   

原文地址:https://www.cnblogs.com/partition-liu/p/12318325.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!