Received: from localhost (uranus.hub.org [200.46.204.60]) by postgresql.org (Postfix) with ESMTP id 0D5179FA372 for ; Mon, 6 Nov 2006 15:04:07 -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 30705-05 for ; Mon, 6 Nov 2006 15:04:04 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from skynet.simkin.ca (skynet.simkin.ca [199.175.137.210]) by postgresql.org (Postfix) with ESMTP id 2BC999FA136 for ; Mon, 6 Nov 2006 15:04:04 -0400 (AST) Received: from crecy.medialogik.com (hal.medialogik.com [72.51.27.120]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by skynet.simkin.ca (Postfix) with ESMTP id 4CA49106DD for ; Mon, 6 Nov 2006 11:04:02 -0800 (PST) From: Alan Hodgson Organization: Simkin Network Consulting To: pgsql-php@postgresql.org Subject: Re: PostgreSQL locking from PHP scripts Date: Mon, 6 Nov 2006 11:05:28 -0800 User-Agent: KMail/1.9.1 References: <20061026181147.50048.qmail@web51309.mail.yahoo.com> In-Reply-To: <20061026181147.50048.qmail@web51309.mail.yahoo.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1855642.pLggj9Dy9g"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200611061105.29055@hal.medialogik.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/8 X-Sequence-Number: 3626 --nextPart1855642.pLggj9Dy9g Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Thursday 26 October 2006 11:11, Amal burman wrote: > postgresql database for this project. Here script one > (booking.php) tries to setup a lock for update and ask > user to fill-up the form. Now when the user fill-up > the form and submit it for update, second script > (update.php) update the database and releasing the > locks.=20 You can't do this kind of thing in PHP. PHP resets the database connection= =20 between scripts. The script is finished as soon as the page is delivered= =20 to the client. Also, web connections are stateless and there is no way to even know what=20 web server process or database connection you'll be getting on subsequent=20 page views. =20 =2D-=20 "It is a besetting vice of democracies to substitute public opinion for law." - James Fenimore Cooper=20 --nextPart1855642.pLggj9Dy9g Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) iD8DBQBFT4d5Jmf5OzX07HQRAk8TAKCaJnuPY0gsHgoW37ikRX/93M+weQCgu4V/ NPfUjtForPdRMp3XYVNoENo= =ZTb/ -----END PGP SIGNATURE----- --nextPart1855642.pLggj9Dy9g--