posted 18 years ago
Hello,
I am fairly new to SQL. We are trying to write a program that invokes a transaction that at one point reads data from a row and locks it temporarily so that another transaction cannot access it at the same time. Once the transaction has completed, the row is then updated/unlocked and available for another transaction to read/use. We are using the select for update sql statement but for some reason we still see two transactions waiting to update the same row, which is causing an error. I read that there are three types of locks, but I'm not sure how to use the correct lock. Any help would be greatly appreciated. BTW, we are using DB2.