Subject Re: Locking tables
Author mikcaau
--- In, "nagypapi" <nagypapi@f...> wrote:
> > So why do you need it or do you need to learn more about versioning?
> How I came to ask this question:
> Let's say my table is full of conference room reservations, each
> record having a starttime timestamp and duration (or endtime
> > nagypapi wrote:

I have a similar need. Each client program, shortly after start, runs
through the list of recurrent reservations and posts any new ones that
are needed. Because each run operates within a transaction it is
possible that two applications could be away writing reservations
without seeing the other.

To map around this I have a control table with (at the moment) one
row. Before the recurrent reservation process can run it tries to
update this row. If it succeeds it keeps the row lock until it haas
finished the Recurrent run.

Other apps that try to update recurrents cannot get a lock on the row
and thus drop back to normal operations.

It will all be better when updating recurrents gets pushed into a
stored proc on the server but that's quite a way off.