in reply to Re: how to tell if ->insert succeeded in DBIx::Class?
in thread how to tell if ->insert succeeded in DBIx::Class?
sub insert_row { my ($self, $run) = @_; if ($run->in_storage) { return; } else { # race condition here $run->insert; return 1; # ??? }
Part of the problem is that the Oracle driver throws an exception for primary key violations. Catching that exception requires that I know what the exception looks like, and that leads to the Oracle-specific code.
If, for instance, $run->insert returned false if the insert failed for a unique index violation, then I could write database independent code.
|
|---|