Direct query.
SELECT * from A1 t;
The data taken at this time is the pre-run data, and other users do not get the data modification at the same time.
Real-time update queries
SELECT * FROM A1 t for update;
For update updates, other managers can do the data operation with update, which limits the number of users, fewer connected users, and can be used when threads are not occupied.
Wait 3 seconds to update
SELECT * FROM A1 t for update wait 3;
In the case of the lock table, update the data of other user commits, and wait 3 for the action of the right operation.
Real-time update queries
SELECT * FROM A1 t for update nowait;
For update nowait is understood literally, without waiting for updates, that is, to update in real time.
Benefits of using the for update nowait: Don't wait indefinitely for locked lines!
Locked data allows other operators to avoid more waiting and more control
Good for interactive applications! Data for multi-user operations can be saved interactively.
If skip locked is used, the locked row can be crossed, and the ' resource busy ' exception report raised by Wait n will not be reported
Oracle for update for UPDATE nowait