Updating a row in db2

A share lock does not block an update by the same program (only blocks others). But if you have selected a bunch of rows in one session and you try to update them from another session then except in the case of UR , the second session will block, correct?Isolation levels can be specified in numerous different ways, including in each individual SQL statement. Also curious to know if developers in DB2 world use the UR isolation level due to obvious reasons of data integrity compromise and what not. I suspect that it may be useful where you dont care about exact computation and need to compute fast but approximate results (e.g.For example, if you app is only allowed to consume 10% of the lock list, your row locks will attempted to be escalated to a table lock if you are updating a lot of rows. 3- start two CLP Windows with autocommmit off ( The command is : db2 c ) Question : how to select and lock the row with the id = 1 in the first clp window and select and lock the row with the id = 2 in the second clp window ?

For updating a LOB in Oracle (using JDBC), you need to lock the row. How Are LOBs implemented in DB2 - Do you have a locator and contents separated? DB2 does not have explicit locking by the application program.DB2 will automatically lock the row(s) depending on the SQL statement(s) and the isolation level (for select statements).Also curious to know if developers in DB2 world use the UR isolation level due to obvious reasons of data integrity compromise and what not. I suspect that it may be useful where you dont care about exact computation and need to compute fast but approximate results (e.g.in cases such as weather forecast etc where results need not be exact - this is just a random example but hopefully you get the idea:)) Many thanx, Same application means the same program running in the same thread.Sorry if the questions are basic - am not familiar with the db2 ... So this is because db2 does not support "read consistency" as supported by Oracle, correct?

Sorry if the questions are basic - am not familiar with the db2 ...

The one exception to this is the lock table SQL statement.

The default is to lock by row, but this can be changed to always lock at the table level when defining (or altering) the table definition.

in cases such as weather forecast etc where results need not be exact - this is just a random example but hopefully you get the idea:)) Many thanx, Interesting... So when you say "There is no lock contention for SQL statements in the same unit of work (same application program)." - you mean that in the same "session" there is no lock contention.

But if you have selected a bunch of rows in one session and you try to update them from another session then except in the case of UR , the second session will block, correct?

Lock escalation can automatically occur from row locks to table locks by DB2 depending on a number of other factors, such as whether the locklist memory is filled up.