Re: problem with stored procedure ,transaction and jdbc

Поиск
Список
Период
Сортировка
От Kris Jurka
Тема Re: problem with stored procedure ,transaction and jdbc
Дата
Msg-id Pine.BSO.4.62.0508121333130.14258@leary.csoft.net
обсуждение исходный текст
Ответ на Re: problem with stored procedure ,transaction and jdbc  (Andres Ledesma <aledes@euskalnet.net>)
Список pgsql-jdbc

On Fri, 12 Aug 2005, Andres Ledesma wrote:

> have you considered to enclose both stored procedures in a transaction inside
> another stored procedure, and call just one from the java code, something
> like :
>
> CREATE FUNCTION stored_procedure_3()....
> BEGIN;
> BEGIN TRANSACTION;
> PERFORM ..     call strored procedure 1
> PERFORM ..     call strored procedure 2
> COMMIT;
> END;
> ' LANGUAGE plpgsql;
>

Postgresql does not allow transactions to be started/stopped inside of a
backend function.  It does support savepoints which do allow work to be
saved and rolled back to, but the function call is still wrapped in an
outer transaction.  For the example above leaving the BEGIN
TRANSACTION/COMMIT off may give you the behavior desired (because the
query itself is wrapped in a transaction).

Kris Jurka

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

Предыдущее
От: Kris Jurka
Дата:
Сообщение: Re: Memory leak in 8.0 JDBC driver?
Следующее
От: Kris Jurka
Дата:
Сообщение: Re: Timestamp changes committed to HEAD