note
Anonymous Monk
<p>How much data are you talking about? The database has to sync after each transaction, and most hard drive setups can only do that about a hundred times a second. Note that every insert/update/other statement counts as a transaction <i>unless otherwise specified.</i> You should instead wrap the inserts in an explicit transaction, like this:</p>
<code>
# assumes RaiseError = 1
eval {
$dbh->begin_work;
# insert 10k records
# ...
$dbh->commit;
} or do {
print "failed to insert records!\n";
$dbh->rollback;
};
</code>
<p>See also [mod://DBI]'s section titled <i>Transactions</i>.</p>
1003930
1003930
0