Nested transaction - I am a bank ??

Поиск
Список
Период
Сортировка
Искать
От
Thapliyal, Deepak
Тема
Nested transaction - I am a bank ??
Дата
Msg-id
1FE5193EE2768D478949FC0AFBFFC43B06EBDE11@mail-sd1.station.sony.com
Список
Дерево обсуждения
Nested transaction - I am a bank ?? "Thapliyal, Deepak" <dthapliyal@soe.sony.com>
Re: Nested transaction - I am a bank ?? Richard Huxton <dev@archonet.com>
Re: Nested transaction - I am a bank ?? "Joshua D. Drake" <jd@commandprompt.com>
Re: Nested transaction - I am a bank ?? "scott.marlowe" <scott.marlowe@ihs.com>
Re: Nested transaction - I am a bank ?? Robert Treat <xzilla@users.sourceforge.net>
Re: Nested transaction - I am a bank ?? David Garamond <lists@zara.6.isreserved.com>
Re: Nested transaction - I am a bank ?? "Nigel J. Andrews" <nandrews@investsystems.co.uk>
Hi,

Assume I have a bank app.. When customer withdraws $10 from his accouint I
have to do following 
	--> update account_summary table [subtract $10 from his account]
	--> update account detail_table [with other transaction details]

Requirement: 
	either both transactions should succeed or both transactions should
be rolled back in case of failure.

Question: 
	if my first update succeeds and second fails (say due to space
errors .. I have inconsistancy ..

Per the thread below stored procedures/functions cannot have commits. I
assume that means that they will be implicitly commited ??

How do I approach this simple requirment using psql ? 

Thx
Deep

-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] On Behalf Of Richard Huxton
Sent: Tuesday, January 13, 2004 4:32 AM
To: Anton.Nikiforov@loteco.ru
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Parse error help needed...


On Tuesday 13 January 2004 12:01, Anton.Nikiforov@loteco.ru wrote:
> RH> Remove the "commit" line - functions cannot define their own
> transactions RH> anyway.
> Do you know if it will be solved sometime? Or this is architecture 
> dependend problem? I mean that transactions are rulez and very helpful 
> rulez when working with large databases.

Nested transactions are on the todo list, but I don't know when they will 
appear.

-- 
  Richard Huxton
  Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings
В списке pgsql-general по дате отправления
От: Chris Ochs
Дата:
Сообщение: Re: sql insert function
От: scott.marlowe
Дата:
FAQ