Hi,
I have a script which inserts some rows in an InnoDB table.
I want to be sure that all the rows are inserted, so i use a mysql
transaction ("start transaction", insertions, and "commit").
Problem is that i also want to avoid a timeout (about 60 000 lines are
concerned and InnoDB tables are much slower than MyISAM ones) and i cut
that process in x reloads of the script.
Let's say for the example my script can insert 10 lines each time it
runs and that i have to insert 15 lines only.
1) the script runs, i guess the "log" of the transaction contains my ten
first lines.
2) the script reloads itself and stop after the last 5 lines (it started
with the 11th line).
3) Guess what i have in my table ?
4) the last 5 lines : the transaction forgot my ten first lines...
I know the mysql connection is lost at the end of the first execution of
the script, but how can i manage this to avoid this loss of data ?
I read in
http://www.php.net/manual/en/feature...onnections.php that a
persistent connection to mysql wasn't the solution, so i don't see today
how handle such a mysql transaction through my x reloads of the script.
The website runs PHP Version 4.3.4 and MySQL version 4.0.16.
Any ideas ?
thanks,
Arnaud
I have a script which inserts some rows in an InnoDB table.
I want to be sure that all the rows are inserted, so i use a mysql
transaction ("start transaction", insertions, and "commit").
Problem is that i also want to avoid a timeout (about 60 000 lines are
concerned and InnoDB tables are much slower than MyISAM ones) and i cut
that process in x reloads of the script.
Let's say for the example my script can insert 10 lines each time it
runs and that i have to insert 15 lines only.
1) the script runs, i guess the "log" of the transaction contains my ten
first lines.
2) the script reloads itself and stop after the last 5 lines (it started
with the 11th line).
3) Guess what i have in my table ?
4) the last 5 lines : the transaction forgot my ten first lines...
I know the mysql connection is lost at the end of the first execution of
the script, but how can i manage this to avoid this loss of data ?
I read in
http://www.php.net/manual/en/feature...onnections.php that a
persistent connection to mysql wasn't the solution, so i don't see today
how handle such a mysql transaction through my x reloads of the script.
The website runs PHP Version 4.3.4 and MySQL version 4.0.16.
Any ideas ?
thanks,
Arnaud
Comment