MT#17657 txns not rolled back when retrying due to non-dbh errors

txn were not rolled back for application errors (i.e. contract id not found),
so the uncommitted txn was picked up for the next iteration and then ratomat
dies with an error like this:

Change-Id: I73382aa9be0b12c4b5e168894b288c6d3e4a3444
rate-o-mat: DBD::mysql::db do failed: Transaction isolation level can't be changed while a transaction is in progress at /usr/sbin/rate-o-mat line 287.
changes/81/5781/2
Rene Krenn 10 years ago
parent 62923a6f78
commit 02db7c6dbf

@ -572,7 +572,7 @@ EOS
join(',', @fragment_fields).",
start_time + ?,duration - ?,1
FROM accounting.cdr
WHERE id = ?
WHERE id = ? AND rating_status = 'unrated'
") or FATAL "Error preparing create cdr fragment statement: ".$acctdbh->errstr;
}
@ -2752,6 +2752,7 @@ sub main {
": " . $error;
$failed_counter_map{$cdr_id} = $failed_counter_map{$cdr_id} + 1;
$failed += 1;
rollback_all();
next; #move on to the next cdr of the batch
} else {
die($error); #rethrow

Loading…
Cancel
Save