Select for update => when unlocking is done?
Posted: Wed 09 Dec 2009 10:04
Hello,
I would like to prevent 2 users to perform the same action on different computers.
If a user updates a row, I would like the second user to be able to select row for update AFTER commit has happened on first computer (so that changes can be visible).
If I make a "select for update" in a TOraQuery (autocommit is off), I would like to know when this lock is released, is it released:
* when the cursor is closed?
* or when the current transaction is ended?
* or can I customize this somewhere?
Subsidiary question:
If I make a select for update in a toraquery, don't close the query, and a second toraquery in the same transaction (linked to same orasession) tries to perform an update on the rows selected in first query, will it be allowed?
Regards.
I would like to prevent 2 users to perform the same action on different computers.
If a user updates a row, I would like the second user to be able to select row for update AFTER commit has happened on first computer (so that changes can be visible).
If I make a "select for update" in a TOraQuery (autocommit is off), I would like to know when this lock is released, is it released:
* when the cursor is closed?
* or when the current transaction is ended?
* or can I customize this somewhere?
Subsidiary question:
If I make a select for update in a toraquery, don't close the query, and a second toraquery in the same transaction (linked to same orasession) tries to perform an update on the rows selected in first query, will it be allowed?
Regards.