Subject | Re: [firebird-support] INSERT or Update and conflict |
---|---|
Author | Anderson Farias |
Post date | 2009-01-20T20:26:49Z |
Hi,
just saying you can't update 'couse someone else is already updating. Handle
this and show a more friendly message to your user saying he need to try
again later (or something)
This way, users don't get a messaging saying it can't update, instead, it
will wait until the transaction that updated the record is commited or
roledback. USE THIS WITH CAUTION.
Regards,
Anderson Farias
>so some time i get some violation of PRIMARY or UNIQUE KEY when 2If you can, use GENERATORs
>client do an INSERT because at the same time these 2 clients do the
>same insert and unfortunatly one of them go in the violation of primary
>key.... I just want to know the best way to handle such situation ?
>now in the same kind, sometime i get 'Update Error - lock conflict onKeep transactions as short as possible. This is not a real *error*, it's
>no wait transaction'. it's when 2 clients try to update the same row at
>the same time. here also how to handle such situation ?
just saying you can't update 'couse someone else is already updating. Handle
this and show a more friendly message to your user saying he need to try
again later (or something)
> is it possible to force the update of the row by the second requestYES. Setup your transactions as WAIT
> instead of raising a lock conflict?
This way, users don't get a messaging saying it can't update, instead, it
will wait until the transaction that updated the record is commited or
roledback. USE THIS WITH CAUTION.
Regards,
Anderson Farias