Re: problems with transaction blocks

Поиск
Список
Период
Сортировка
От Vivek Khera
Тема Re: problems with transaction blocks
Дата
Msg-id x7isjmyufq.fsf@yertle.int.kciLink.com
обсуждение исходный текст
Ответ на problems with transaction blocks  ("Chris Ochs" <chris@paymentonline.com>)
Список pgsql-general
>>>>> "BW" == Bruno Wolff, <Bruno> writes:

BW> Currently there is no provision for recovery from error by the application
BW> inside a transaction. What you can do is have the application check for
BW> problems before trying the insert. Depending on the problems you expect,

I have an application that does this.  First it attempts to do a mass
number of inserts based on some external events all inside a
transaction.  If we abort due to referential integrity constraint
violation, we restart the whole process but before each insert a check
is done to see if the required FK's are satisfied.

This gives us the benefit of 99% of the time when the FKs are ok we
zip along pretty darned fast, and for the 1% of the time when some
stale data is re-injected into the stream, we just restart that batch
and pay the penalty for it.

The benefit of being able to do all the inserts within a single
begin/end cannot be understated.


--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D.                Khera Communications, Inc.
Internet: khera@kciLink.com       Rockville, MD  +1-301-869-4449 x806
AIM: vivekkhera Y!: vivek_khera   http://www.khera.org/~vivek/

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

Предыдущее
От: Vivek Khera
Дата:
Сообщение: Re: problems with transaction blocks
Следующее
От: "Andrew Bartley"
Дата:
Сообщение: Re: beginner query help