Re: dbi transactions error handling

2010-09-21 Thread Paolo Lunazzi
Ok, now I understand where is my mistake. I set $dbh->{RaiseError} = 1 after declaring the statements $sql_live and $sql_dwh so these have the original value of RaiseError. In this case I have to modify the property of the single statements. Thanks, PL On Sep 20, 7:11 pm, imhar...@nuskin.com (Ian

Re: dbi transactions error handling

2010-09-21 Thread Paolo Lunazzi
Thanks for your solution. Your code works well but I don't understand why in my example eval doesn't catch the error and why, even in your example, with PrintError = 0 I get on output all the warnings of statements failed. Transactions section in DBI documentation recommends to use RaiseError and e

RE: dbi transactions error handling

2010-09-20 Thread Ian Harisay
I think you would be better off to write it like this. $dbh->{RaiseError} = 0; $dbh->{PrintError} = 0; $dbh->{AutoCommit} = 0; my @record = ($row_id, $file_id, $offset, $country, $date_day, $campaign, $leaf_id, $status_id); my $rv; SWITCH: { last unless($rv = $sql_live->execute(@record)); l