Subject | Re: Weird behaviour |
---|---|
Author | Adam |
Post date | 2004-12-28T23:04:16Z |
Is there an index on URN? My guess is that the IsLocked is being
called for every record on the tracking screen, either directly or
accidentally, but you can test that using Delphi.
If it is any help, you may not need to use the IsLocked mechanism
with Firebird. Firebird locks a record to other transactions as soon
as your transaction updates it until you commit or rollback.
When they double click a record, you could just run your locking
query. (Update LOG Set Being_used = "Y" Where URN = ?). Providing you
set your transaction type to the second one (my memory fails me what
it is called), any other user that tries that command will get an
exception that you can catch and convert to your warning message. You
actually never need to read the Being Used flag from the Log File.
Another issue may be if your transaction is on wait-commit (or
whatever the first one is), your query may be waiting for another
user to commit or rollback their work before it proceeds.
Was this app ported from Paradox by chance?
called for every record on the tracking screen, either directly or
accidentally, but you can test that using Delphi.
If it is any help, you may not need to use the IsLocked mechanism
with Firebird. Firebird locks a record to other transactions as soon
as your transaction updates it until you commit or rollback.
When they double click a record, you could just run your locking
query. (Update LOG Set Being_used = "Y" Where URN = ?). Providing you
set your transaction type to the second one (my memory fails me what
it is called), any other user that tries that command will get an
exception that you can catch and convert to your warning message. You
actually never need to read the Being Used flag from the Log File.
Another issue may be if your transaction is on wait-commit (or
whatever the first one is), your query may be waiting for another
user to commit or rollback their work before it proceeds.
Was this app ported from Paradox by chance?