Received: from localhost (uranus.hub.org [200.46.204.60]) by postgresql.org (Postfix) with ESMTP id 6F5CB9FB24D for ; Mon, 6 Nov 2006 22:27:49 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.60]) (amavisd-new, port 10024) with ESMTP id 03590-09 for ; Mon, 6 Nov 2006 22:27:46 -0400 (AST) X-Greylist: delayed 00:31:13.014782 by SQLgrey- Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 8A57B9FB267 for ; Mon, 6 Nov 2006 22:27:46 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from tiggs.net (206-223-169-74.beanfield.net [206.223.169.74]) by svr4.postgresql.org (Postfix) with ESMTP id 4FD195AF03A for ; Tue, 7 Nov 2006 01:56:31 +0000 (GMT) Received: from localhost (206-223-169-82.beanfield.net [206.223.169.82]) by tiggs.net (Postfix) with ESMTP id 456BE27E40D; Mon, 6 Nov 2006 19:56:29 -0600 (CST) Received: from tiggs.net ([206.223.169.74]) by localhost (mx1.hub.org [206.223.169.82]) (amavisd-new, port 10024) with ESMTP id 67391-01; Tue, 7 Nov 2006 01:56:27 +0000 (UTC) Received: from [10.0.1.201] (unknown [68.187.34.210]) by tiggs.net (Postfix) with ESMTP id CF24727E411; Mon, 6 Nov 2006 19:56:26 -0600 (CST) Message-ID: <454FE7C7.2030102@tiggs.net> Date: Mon, 06 Nov 2006 19:56:23 -0600 From: Charley Tiggs User-Agent: Thunderbird 1.5.0.7 (Macintosh/20060909) MIME-Version: 1.0 To: Herbie McDuck Cc: pgsql-php@postgresql.org Subject: Re: PostgreSQL locking from PHP scripts References: <20061026181147.50048.qmail@web51309.mail.yahoo.com> <200611061105.29055@hal.medialogik.com> <454FD71E.6070807@faams.net> In-Reply-To: <454FD71E.6070807@faams.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/13 X-Sequence-Number: 3631 Herbie McDuck wrote: >> Also, web connections are stateless and there is no way to even know >> what web server process or database connection you'll be getting on >> subsequent page views. >> > So is PHP and 'ANY' database a useless adventure when it goes to > developing a robust business and accounting package? Not at all. It just means that you'll have to create your own "state" logic using sessions. For instance, create a column within the necessary table that you can check to see whether or not some other process/user is using the record in question and then build the necessary logic around that to enable/disable access to the records. This is something that isn't specific to PHP. You'll encounter the same issues with any other middleware language that uses a web browser as it's primary means of interaction. HTTP just doesn't keep track of the state of your application. It's up to you as the developer to handle that. Charley