Subject Re: Locking tables
Author Adam
Hello Gustavo,

The easiest way I know is to have a table that acts as a gate.



Then when you discover you need to use TableA, run the query

update tablelock
set tablename = tablename
where tablename = 'TableA';

If everything that tries to access tableA must first "seek permission"
from the tablelock table, you can do it this way.

But it is worth remembering that Firebird has multi-version records.
This means that in many cases, you do not actually need to lock the
table to maintain isolation. The changes made by other transactions
will not be visible to your transaction, so you can carry on as if
nothing had happenned.

>>Sometimes my application does processing on big tables that last a
>>lot of time and it needs to be sure that it can complete the
>>operation when it commits the transaction.

When the transaction commits it has completed. Are you worried that it
may get near the end of its processing and have to roll back because
some other transaction has modified a record you want to modify?