logo       


Re: PostgreSQL locking from PHP scripts: msg#00013

Subject: Re: PostgreSQL locking from PHP scripts
On Monday 06 November 2006 20:24, Chris wrote:
> Herbie McDuck wrote:
> > Alan Hodgson wrote:
> >> On Thursday 26 October 2006 11:11, Amal burman <amalburman@xxxxxxxxx>
> >>
> >> 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.
> >>
> >> You can't do this kind of thing in PHP.  PHP resets the database
> >> connection between scripts.   The script is finished as soon as the
> >> page is delivered to the client.
> >>
> >> 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?
>
> No, it applies to anything you do in a web browser.
>
> The HTTP protocol is "stateless" which means all resources, connections
> etc are killed at the end of the script. Resources of any type are not
> kept alive at the end of a script.
>
> It's not a php thing or <insert random language here>, it's a HTTP
> protocol thing.

In theory you can use prepared transactions to get around this, but I've never 
seen anyone fully implement it in PHP. 

-- 
Robert Treat
Build A Brighter LAMP :: Linux Apache {middleware} PostgreSQL

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org



Ruby Jobs
Java Jobs
Jobs in California
more...
what
job title, keywords
where
city, state, zip
jobs by job search
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
encryption.gpg....    ietf.rfc822/199...    freebsd.devel.i...    lang.haskell.li...    mail.squirrelma...    web.zope.plone....    yellowdog.gener...    text.xml.xalan....    recreation.phot...    kde.devel.educa...    hardware.bus.ca...    printing.ghosts...    voip.peering/20...    assembly/2006-0...    org.user-groups...    culture.interne...    network.i2p/200...    boot-loaders.ya...    xfree86.render/...    qnx.openqnx.dev...    jakarta.velocit...    user-groups.pal...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe