Re: Transaction Exception Question

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Transaction Exception Question
Дата
Msg-id 20020814141607.A4047@svana.org
обсуждение исходный текст
Ответ на Re: Transaction Exception Question  (Jon Swinth <jswinth@atomicpc.com>)
Ответы Re: Transaction Exception Question  (Jon Swinth <jswinth@atomicpc.com>)
Список pgsql-general
On Tue, Aug 13, 2002 at 10:42:07AM -0700, Jon Swinth wrote:
> Thanks Scott for your reply.
>
> I don't agree that an insert/update/delete error should automatically abort
> the transaction.  You have not provided for the fact that the error may be
> handled.  I will give you an example that makes my case.
>
> Lets say you have an inventory table.  The inventory table has a primary key
> of an integer and a unique key of location and product.  The unique key makes
> sure that there is only one record for each product against a single
> location.  Now imagine that you have a high volume database with many clients
> and you have a process that attempts to put quantity of a product into a
> location.  That process would first select to see if the record already
> existed so it could be update and then insert a row when it wasn't found.
> Now imagine that this is just part of a long running transaction and that
> multiple clients will want to put more of the same product in the same
> location.

Quick question (maybe I'm misunderstanding something) but why are all these
unrelated queries all in the same transaction? If you commited between each
update your problem goes away.

What you are trying to do could be acheived using using LOCKs but you don't
want that.

--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> There are 10 kinds of people in the world, those that can do binary
> arithmetic and those that can't.

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

Предыдущее
От: Emmanuel Charpentier
Дата:
Сообщение: Re: Blob stuff
Следующее
От: "Christopher Kings-Lynne"
Дата:
Сообщение: tsearch vs. fulltextindex