Background
I have a table (Table_Keys) that contains the next unique key to use for certain tables. I am developing an application for a mutli-user environment and there is a high level of probability that this table will get accessed several times (1000's of times) throughout the day.
I have written an algorithm that gets the next key from the table and then writes the next available key back after incrementing the key. The key is alpha-numeric. To ensure data integrity, I need this algorithm to have full control of the row it is accessing in the Table_Keys table. This "lock" should not be released until the next key has been written back to the table.
Question
If two applications submit a SELECT FOR UPDATE against the Table_Keys table, will transaction 2 wait to retrieve the row it is accessing until transaction 1 is completely finished with its read and write execution?
I have a table (Table_Keys) that contains the next unique key to use for certain tables. I am developing an application for a mutli-user environment and there is a high level of probability that this table will get accessed several times (1000's of times) throughout the day.
I have written an algorithm that gets the next key from the table and then writes the next available key back after incrementing the key. The key is alpha-numeric. To ensure data integrity, I need this algorithm to have full control of the row it is accessing in the Table_Keys table. This "lock" should not be released until the next key has been written back to the table.
Question
If two applications submit a SELECT FOR UPDATE against the Table_Keys table, will transaction 2 wait to retrieve the row it is accessing until transaction 1 is completely finished with its read and write execution?