ADO.Net vs ADO Record Locking
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
精彩评论