When Oracle operates on a row in a database how does it lock that row

  • 2020-06-07 05:28:15
  • OfStack

select for update
This is a row-level lock
When commit or rollback, the lock is released
Remember to open transactions, such as jdbc
setAutoCommit(false);
The steps are as follows:
1 setAutoCommit is false in JDBC
2 In Oracle query, using for update sentence, lock all select out of the record row
3 Perform required operations
4 con.commit() above
To complete.

Related articles: