Subject Re: Record Locking (was: IBO - Long time opened Query)
Author Christian Gütter
Hi Lester,

> I 'lock records' by setting a status flag and commiting that
> change rather than relying on pessimistic locking. The flag
> can then be checked in any triggers, and operations
> controlled - outside of a blocked transaction. That may not
> be prectical for you, but works for me, and allows accurate
> control of who is updating a record ( the flag is a user
> number <g> ). This is not used often, as I normally edit
> 'offline' and flag any changes when trying to post the update.

I am investigating different ways of record locking for
an application which involves editing larger documents
(invoices etc.). I quite like the way you are doing it
and would like to know if I understood you correctly.

AFAIU, locking records in the "Lester way" consists of
the following steps:

1. start a transaction
2. set lock field of record to user number
3. user edits the record
4. user has finished editing, so clear lock field
5. if user saves the doc then commit the transaction,
otherwise rollback transaction

Have I understood you correctly?


TIA,
Christian