Re: basic stored proc/transaction question

Поиск
Список
Период
Сортировка
От Ian Harding
Тема Re: basic stored proc/transaction question
Дата
Msg-id 725602300603241023haa779dei848e39255c43cf96@mail.gmail.com
обсуждение исходный текст
Ответ на basic stored proc/transaction question  (Ben <bench@silentmedia.com>)
Ответы Re: basic stored proc/transaction question  (Ben <bench@silentmedia.com>)
Список pgsql-general
On 3/24/06, Ben <bench@silentmedia.com> wrote:
> My understanding is that a stored procedure does an implicit begin/commit when
> it executes. Maybe my brain isn't working so well this morning, because I can't
> figure out how I would do:
>
> begin;
> call stored proc;
> call another stored proc;
> commit;
>
> It seems that the transaction would be committed after the first call.
>
Nope.  Unless you use the new SAVEPOINT stuff, the explicit
transaction is the transaction.  Any error in any function will
rollback the whole thing.  The commit happens at the explicit commit.

Every SQL statement (such as calling a function) runs in an implicit
transaction.  Explicit transactions effectively "group" these implicit
transactions such that any one failure causes them all to fail.

- Ian

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

Предыдущее
От: Julie Robinson
Дата:
Сообщение: Re: Hibernate Query Question - Get most recent unique rows
Следующее
От: Ben
Дата:
Сообщение: Re: basic stored proc/transaction question