1. When manipulating DML (create,insert,update) statements, Oracle automatically adds row-level locks when the select * from table for update "of column" "Nowait|wait 3" Oracle also locks automatically
Recommendation (1) nowait is generally added to the for update so that no other transaction is executed, and a transaction is determined and an error is thrown immediately.
Recommendation (2) The general of column is a multi-table operation, you can lock some of the columns of one table, if it is the same table, you cannot lock some columns
2, table-level lock
Table-level locks contain row-level locks, (1), (2) also through row-level locks to achieve table-level locks, they do not have strict classification, table-level lock is Oracle directly sweep the entire table to determine the transaction, rather than to scan each row in the list to determine the transaction, this is useful at some point
Table-level locks are divided into many types (mode):
(1) row sharing (row SHARE) – Prohibit exclusive lock table (2) row exclusive (row EXCLUSIVE) – Disables locking of tables with exclusive and shared locks (3) shared locks (SHARE) (4), allowing other users to query only rows in tables to prevent other users from inserting, updating, and deleting rows more Users can apply this lock on the same table at the same time (5) shared row exclusive (SHARE row EXCLUSIVE) – more restrictions than shared locks, prohibit the use of shared locks and higher locks (6) Exclusive (EXCLUSIVE) – Restrict the strongest table locks and allow other users to query only rows of the table. Prohibit modifying and locking tables General syntax: Lock table STUDENT in exclusive mode; (table-level lock Exclusive)
However, in the Java program How to call such a statement, temporarily did not get out, these statements in the DBA's use of more
Row-level and table-level locks for Oracle