Scope of OleDB locking

Don Glover 516 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?

Microsoft 365 and Office | Access | Development
Developer technologies | VB
0 comments No comments
{count} votes

Answer accepted by question author
  1. Xingyu Zhao-MSFT 5,381 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) 81,976 Reputation points Volunteer Moderator
    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' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.