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.
Select for update => when unlocking is done?
The lock is released when you commit or rollback the transaction. Note that TOraQuery has the LockMode property. If this property has a value other than lmNone, ODAC automatically locks the record when you edit it.
If you lock records in one TOraQuery, you can change them in another TOraQuery that belong to the same session.
If you lock records in one TOraQuery, you can change them in another TOraQuery that belong to the same session.