You may want to look at isolation levels ... CS, RR, RS and UR. You can control the manner in which db2 locks the rows for a SELECT statement using these isolation levels ...
This is probably the tutorial you want to start with :
http://www-128.ibm.com/developerwork...11&S_CMP=LPDB2
Otherwise, locking is internally handled by DB2 ... You don't need to do locking using LOCK TABLE statements ..
The LOCK TABLE Statements are normally used when you want to avoid row locks escalationing to table lock - rather you issue LOCK at the very beginning ...
HTH
Sathyaram
Quote:
|
Originally Posted by bboy_vitasoy
Hi,
I have a school project in which I have to use locking to handle multiple users. Is there a locking command to make Exclusive and Shared locks?
I'm totally in the dark about this. Any good tutorials you can point me to?
I'm using "Command Line Processor for DB2 SDK 8.2.2"
Thanks a lot!
Sincerely,
Arthur.
|