How do DBMS handle optimistic locking?
Date: Sun, 29 Jul 2007 01:03:26 +0200
Message-ID: <mnina3hifckosipddfh0ej5f0eqio5528h_at_4ax.com>
Hello,
I was wondering: How do server-based DBMS (PostgreSQL, Oracle,
etc.) handle concurrent updates with optimistic locking?
Say user A sends a SELECT over the LAN to the server to grab an
employee's personal details, and feed them to a grid object on the
client. While he's making changes to it, user B is also making changes
to the same employee, and sends his update while User A is still
working.
When user A sends his updates... the DBMS server will generate an
error, and ask user A to choose which changes to keep: His or User
B's.
How do DBMS's handle this? Do they use some kind of ticket to keep
track of what state the table was in when user A sent his SELECT, and
when the client wants to perform an UPDATE, the DBMS compares this
ticket to the local ticket, and sends an error if they don't match?
Thank you.
Received on Sun Jul 29 2007 - 01:03:26 CEST