5

What happens if two transactions try to modify the same row simultaneously? Normally, once the row is modified, the other transaction waits until the first one performs commit or rollback. But what if they send the update requests exactly at the same moment?

1
  • 2
    The behavior is exactly what you describe as normally. Although both transactions send their update at the same time, one of them will get executed before the other. Commented May 3, 2021 at 6:59

1 Answer 1

6

The answer is a big NO. Two transactions can not modify the same row at the same time. A transaction is a single logical unit of work that accesses and possibly modifies the contents of a database. Transactions access data using read and write operations. In order to maintain consistency in a database, before and after the transaction, certain properties are followed. These are called ACID properties.

To go into more detail on how Oracle implements locks you may want to read about transaction isolation level oracle offers, latches, locks, and ITL.

Sign up to request clarification or add additional context in comments.

3 Comments

So, which transaction's update will be executed? Because they sent the requests simultaneously
For you it is simultaneous but there are semaphores in place which will only allow one transaction to happen.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.