Subject Re: How to 'lock' a table?
Author maximshiryaev
Hi.

As for me I use an explicit lock table for that. Something like this:

create table my_lock (
abc integer
);

insert into my_lock
values (1);

and at the proc start I do:

update my_lock
set abc = 1;

this will lock the record in my_lock and prevent other transactions
from modifying it. Since others will try to do it in the first line
they fail or wait depending on the transaction parameters.

If you need more independent locks you can add them to my_lock with
unique values and update with "where abc = <some_lock_identifier>"

Maxim.



--- In firebird-support@yahoogroups.com, "Fabiano Bonin"
<fabianobonin@...> wrote:
>
> Hi,
>
> I have an application that process thousands of material
transactions per day.