Maybe you just need to dbh->commit (to prevent an automatic rollback)?
In reply to Re: My update on insert error solution by erix in thread My update on insert error solution by PeterKaagman