Subject RE: [firebird-support] Question about meaning of exception.
Author Alan McDonald
> Hello Group,
>
> Can someone please explain to me the difference between the following
> exceptions raised by Firebird?
>

I use IBO components so the transaction types are slightly different but
if I use tiConcurrency with pessimistic locking (dummy update attempt), I
get this first exception.

> ---
> lock conflict on no wait transaction
> violation of FOREIGN KEY constraint "FK_BAR" on table "FOO"
> ---

when users are denied an attempt to start editing. They can choose to sit
there and wait for another attempt if they like. If they wait and try again
there are two possibilities:
1: the other user editing rolled back there transaction thereby cancelling
their edits, in which case this current user's next attempt will be
successful and editing proceeds.
OR
2: the other user committed changes and thus the current user is sitting on
a record which has changed. The user's attempt to edit will be met with this
second exception:
>
> and
>
> ---
> deadlock
> update conflicts with concurrent update
> ---

and the application provides a refresh at this point so the user can update
their view of the changed record so that editing can proceed on the changed
record.
Alan


>
> I know that the parent record exists for the first case (unless my
> problem is deeper than I suspect). Is it complaining rather about the
> fact that a different transaction may be simultaneously updating the
> parent record (although definately not touching the primary key field)?
>
> Thanks in advance
>
> Adam