X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 2009D3CCEF2 for ; Fri, 17 Dec 2004 18:07:17 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 94102-10 for ; Fri, 17 Dec 2004 18:07:11 +0000 (GMT) Received: from wi-vmail1.wi1.uni-muenster.de (WI-VMAIL1.UNI-MUENSTER.DE [128.176.158.8]) by svr1.postgresql.org (Postfix) with SMTP id 2ED8B3CCE8B for ; Fri, 17 Dec 2004 18:07:11 +0000 (GMT) Received: from pcwi4002.uni-muenster.de ([128.176.159.107]) by wi-vmail1.wi1.uni-muenster.de with Microsoft SMTPSVC(6.0.3790.211); Fri, 17 Dec 2004 19:07:10 +0100 To: Jan Wieck Cc: Greg Stark , pgsql-interfaces@postgresql.org Subject: Re: Lost updates vs resumable connections/transactions References: <41C06961.8020406@Yahoo.com> <87is73qrde.fsf@stark.xeocode.com> <41C1CE7A.10405@Yahoo.com> <41C306A1.1070807@Yahoo.com> <41C31A2E.9030107@Yahoo.com> From: Jens Lechtenboerger Date: Fri, 17 Dec 2004 19:07:08 +0100 In-Reply-To: <41C31A2E.9030107@Yahoo.com> (Jan Wieck's message of "Fri, 17 Dec 2004 12:41:02 -0500") Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-OriginalArrivalTime: 17 Dec 2004 18:07:10.0530 (UTC) FILETIME=[3A5D3A20:01C4E463] X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200412/32 X-Sequence-Number: 5202 Jan Wieck writes: > On 12/17/2004 12:04 PM, Jens Lechtenboerger wrote: > >> Jan Wieck writes: >> >>> [...] >>> I don't think this idea has much of a chance to make it into the >>> source tree. >> I'm disappointed, though, and summarize: >> PostgreSQL transactions cannot be used naturally with CGI/PHP, and >> virtually every web application out there is prone to lost updates. > > As said, open transactions with DB locks during user interaction are a known > bad idea for every sort of application. That together with the scaling > problems is IMHO reason enough not to implement something that is designed to > avoid proper application side advisory locks. After writing my last mail, I was riding my bicycle through the rain and thought about the following additional application areas for an API extension: Grid computing: I might want to transfer a transaction from an overloaded client node to another node. Currently, this is not possible. Web services: I might want to compose an atomic service out of component services over a single database. In contrast to my previous web example, in this scenario there needn't be user interaction between the individual service invocations. > Get used to put reasonable amounts of your business logic into stored > procedures on the database side and you will find that dealing with advisory > locks is not as painfull as it looks like. Doing it all with PHP coding alone, > where a single business process is scattered over a input form flow dictated > number of source files is neither as easy, nor as maintainable. There is a fundamental problem. It's not about "scattered" business processes but about the very simple "look and edit" process that is not supported. Jens