开发者

ADO.Net vs ADO Record Locking

开发者 https://www.devze.com 2023-01-23 06:47 出处:网络
I\'m struggling to understand the differences between ADO and ADO.NET. ADO \"Classic\" has different lock levels... I\'m wondering now, what is the default lock level for ADO.NET? How would I open a

I'm struggling to understand the differences between ADO and ADO.NET.

ADO "Classic" has different lock levels... I'm wondering now, what is the default lock level for ADO.NET? How would I open a connection a开发者_如何学运维s Batch Lock or Read Only.

What is the default behavior of ADO.NET? What sort of lock does it place on a MSSQL database when doing a .fill().


ADO.net uses an optimistic locking concurrency by default but you also have to look at what is happening on the SQL server.

Unless you specify a hint such as NoLock a shared lock will be issued. This is a lightweight lock that allows other transactions to read a resource but no other transactions to modify the data. This lock is released after the data is finished being read

0

精彩评论

暂无评论...
验证码 换一张
取 消