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?
Asked
Active
Viewed 1,857 times
5
-
2The 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. – Thorsten Kettner May 03 '21 at 06:59
1 Answers
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.

Aman Singh Rajpoot
- 1,451
- 6
- 26
-
So, which transaction's update will be executed? Because they sent the requests simultaneously – oramas May 03 '21 at 06:53
-
2For you it is simultaneous but there are semaphores in place which will only allow one transaction to happen. – Aman Singh Rajpoot May 03 '21 at 06:57
-
1Read on semaphores https://docs.oracle.com/cd/E19683-01/806-6867/6jfpgdcnj/index.html – Aman Singh Rajpoot May 03 '21 at 06:59