Time Consuming DB-Transaction
| From: | Hannes Wyss | Date: | Mon, 17 Jun 2002 08:38:27 +0000 |
| Subject: | Time Consuming DB-Transaction | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-19843@lists.php.net to get a copy of this message | ||
Hi list,
I need to provide the facility to upload a large csv-file (>800kb) to my customer, do some expensive string comparison stuff (cut off empty lines or superfluous fields - Excel-Generated csv seems to be unpredictable in some cases; convert some of the fields - '3%' -> 3) and then load the file or insert each row into a postgres backend.
This takes anywhere between 20 secs and 90 secs at the moment, and the file is likely to grow in the near future.
How can I provide feedback to the user while keeping the db-transaction running and providing rollback facilities in case of a failure?
tia.
Hannes