Subject Re: Pessimistic locking
Author hay77772000
--- In firebird-support@yahoogroups.com, Helen Borrie <helebor@t...>
wrote:
> At 02:44 PM 22/09/2003 +0000, you wrote:
> >Hi,
> >
> >I have to lock a set of tables, do some stuff in my app, and then
> >unlock the tables.
> >
> >How can I do this with firebird?
>
> Can you explain a bit more about what you want to achieve
by "locking a table"?
Ahhh...I see your point! We don't actually need to lock the whole
table after all!

A question though - if I add a record to a table, along with
multiple associated records in tables with foreign keys, do I need
to do any kind of locking?

Many thanks,

David

>
> >With SAP, I could just issue a LOCK on a table...
>
> With Firebird, you have various levels of transaction isolation
with
> various effects what other transactions can do/see. Locking is at
> row-level and can be at set-level.
>
> For a total blackout of tables to other transactions, you can get
a
> table-level lock using a RESERVING clause in the transaction spec,
but it's
> extremely rare to need that.
>
> heLen