Mysql and rollbacks
| From: | Peter Westergaard | Date: | Tue, 13 Jul 2004 15:20:32 +0000 |
| Subject: | Mysql and rollbacks | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-35219@lists.php.net to get a copy of this message | ||
I'm developing a site where I anticipate the need to make several updates to
several forms, and I'll want to "commit" them all at once (i.e. if there's a
failure with any of the transactions, I'd like to be able to back out to
before I started).
Is there a decent way to do this with PHP and Mysql? Obviously start with
ignoring user interrupt, and I was thinking a fairly easy way to reduce the
risk is to perform numerous tests before attempting any activity, but that
means at least doubling my database activity - does that pose more
performance issues than it solves?
Or has someone else got a good strategy for dealing with this? Perhaps
writing temp-rows, and then executing some sort of stored procedure to move
all the temp-rows to the real tables in one fell swoop? Or, really, any
wisdom to impart?
-P