will I need nested transactions ?

Поиск
Список
Период
Сортировка
От Andreas
Тема will I need nested transactions ?
Дата
Msg-id 40A8D292.7040705@gmx.net
обсуждение исходный текст
Ответы Re: will I need nested transactions ?  (Richard Huxton <dev@archonet.com>)
Re: will I need nested transactions ?  (Ben <bench@silentmedia.com>)
Список pgsql-general
Hi,

will I need "nested transactions" which - as I read - aren't
implemented, yet ?

I have some objects that rely on each other.
Each has a status like proposal, working, canceled.

table-A   <---   table-B   <---   table-C   <---   table-D

Those are  (1, OO)  relationships,
A status change above gets cascaded down but not upwards.
If I try to cancel a table-A-record every "lower" record in B, C, D
should be canceled, too, when the transaction is committed.
Since it is possible, that I cancel e.g. a table B object only its
children should get updated but not table-A.

I thought somthing along this to cancel a type B object:

BEGIN
    BEGIN
        BEGIN
               UPDATE table-D
         END
         if no error UPDATE table-C
    END
    if no error UPDATE table-B
END

Does this make sense and will it provide the necesary protection ?

BTW the client is Access 2000 via ODBC talking to an PostgreSQL 7.4.2 on
Linux.


Regards
Andreas

В списке pgsql-general по дате отправления:

Предыдущее
От: Milos Prudek
Дата:
Сообщение: Re: serial autoincrement and related table
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: will I need nested transactions ?