READ_UNCOMMITTED vs No transactions?

前端 未结 2 1501
醉梦人生
醉梦人生 2020-12-21 17:35

What\'s the difference between executing SQL outside of a transaction versus executing it under READ_UNCOMMITTED isolation mode?

Clarification: I\'m

2条回答
  •  粉色の甜心
    2020-12-21 18:14

    READ_UNCOMMITTED (or dirty reads) will give you information about transactions that have yet to be completed.

    It's not usually a good idea since the information retrieved may be inconsistent. We've used it to avoid deadlock in reporting applications where slightly-off data doesn't matter but, if you care at all about accuracy (like charging people money, or banking), I wouldn't do it.

    Executing SQL outside of a transaction (I'm assuming updates here) should not really be possible. The ACID requirements generally need transactions even for the simplest update - you may not explicitly BEGIN or COMMIT the transaction but I'll guarantee it'll be happening under the covers (at least for a decent relational DBMS).

提交回复
热议问题