Oracle does not lock data if only select is used in Oracle. When the data is being modified by another process, the results obtained by using Select are not up to date.
This requires a for update, and when Oracle finds that a record that satisfies the condition is being updated, it does not execute the SELECT statement immediately, but waits until the end of the update to execute the SELECT statement.
There are two other ways to use it:
For UPDATE nowait: When Oracle discovers that a record that satisfies a condition is being updated, it throws an exception instead of waiting, and we catch an exception in the program to understand what is going on and take appropriate exception handling.
For update wait 3: When Oracle discovers that a record that satisfies the criteria is being updated, it waits until the update is over 3 seconds and throws an exception.
Oracle for update usage