Live queries

igon

Member²
When one workstation is in a record live with the statement
SELECT TB.*,TB.ROWID FROM SOMETABLE WHERE ... and another workstation tried to do the same on the same record it appears as if the application is locked on the second workstaion until the first is done. Is there any way that the second workstaion will not sit forever but will time out or signal that the other workstation is locking the record?
 
An application will only wait for locks if you execute update, delete, or select ... for update statements without explicitly locking the record first. A TOracleDataSet will never do this, unless:
  • You specified a select ... for update in the SQL of the dataset. You should probably avoid this.
  • You have set the LockingMode property to lmNone. This is not appropriate for multi-user applications.

I hope this helps.

------------------
Marco Kalter
Allround Automations
 
If You want to have the explicit lock (with "select ... for update") and wont have the second worskstation waiting you can use the following statement:
"select ... for update nowait";
But: all Queries to this table have to come with "for update nowait".

When execute this query while an other session has locked the table you will become an EOracleError-Exception with the errorcode 54 wich you can hanle.

------------------
Oliver Kaesmann
 
Back
Top