Scope of OleDB locking

Don Glover 511 Reputation points
2021-07-20T02:32:08.387+00:00

Looking at OleDbConnection.BeginTransaction Method
https://learn.microsoft.com/en-us/dotnet/api/system.data.oledb.oledbconnection.begintransaction?view=dotnet-plat-ext-5.0

It is not clear, is the locking only within the same app instance ie one user using the database OR If have two users using the app on different machines will the record be locked against read by the second user?

VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,724 questions
Access Development
Access Development
Access: A family of Microsoft relational database management systems designed for ease of use.Development: The process of researching, productizing, and refining new or existing technologies.
877 questions
0 comments No comments
{count} votes

Accepted answer
  1. Xingyu Zhao-MSFT 5,366 Reputation points
    2021-07-22T01:55:43.777+00:00

    Hi @Don Glover ,

    As far as I know, when starting a transaction, it does not lock the database, but it ensures isolation of updates of the database in part related to the transaction. and it guards database consistency at all times.

    Best Regards,
    Xingyu Zhao
    *
    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 65,131 Reputation points
    2021-07-22T15:02:45.29+00:00

    The locking (actually isolation) is at the connection level. If your app used two connections, then they would also be locked against each other.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.