Re: Postgres-Php-Transaction

From: Date: Mon, 20 May 2002 10:00:38 +0000
Subject: Re: Postgres-Php-Transaction
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-19270@lists.php.net to get a copy of this message
Does this happen with latest PHP? If yes, please report this as a bug. PS: Current PostgreSQL module is trying to rollback uncommitted transactions when request is finished. This is old postgresql module issue, probably. -- Yasuo Ohgaki Max Buvry wrote:
Hi, I use Postgresql 7.0 + php-4.0.2 and I meet a problem with the transactions. The problem is the famous example of the bank accounts and the money transfers. My script php follows this steps :
        BEGIN WORK
        UPDATE the first bank account
        sleep(300)
        UPDATE the second bank account
        COMMIT WORK
While the sleep, the client uses the STOP button on his browser and stops the connection. The first update is accepted : it seems that the transaction is autocommited when the execution is stopped. I find a solution with php by using ignore_user_abort() and connection_aborted(). But I should prefer an other method. For example anybody knows if it is possible to speficy the autocommit to not when the connection is opened ? In advance, thanks for your response. mb ps : I test the same thing with Postgresql only and if the transaction is not closed, the previous requests are "rollback" which is better for me.


« previous php.db (#19270) next »