Subject Re: INSERT or Update and conflict
Author Adam
--- In, "svanderclock"
<svanderclock@...> wrote:
> >
> > What do you mean by the "same" insert? Do you mean they literally
> > attempt to insert records with the same values, or do you mean that
> > two clients attempt to insert *different* records but using the same
> > primary key?
> literally the same values !! exactly the same row ...
> > If the first, then presumably you can safely ignore the error.
> yes, but i m just worried about the stability of firebird in case of
> much error like this? is it better to commit the transaction or
> rollback it ?

It doesn't matter from Firebird's POV. If a statement encounters an
exception, any changes made between the start of the statement and
that exception are automatically undone (before insert triggers etc).

Whether a commit or rollback is more appropriate depends on what you
have done in your transaction prior to issuing that statement. In
terms of accounting, a commit is cheaper than rollback, but if
Firebird determines no change has been made when you call rollback, it
just flags the transaction as committed anyway (IIRC).