Subject | Re: [firebird-support] Deadlock exception occurs but it shouldn't? |
---|---|
Author | Mark Rotteveel |
Post date | 2014-12-24T09:39:49Z |
On 24-12-2014 09:22, brucedickinson@... [firebird-support] wrote:
concurrently, you will simply get a lock conflict; I don't think there
is a way around this.
Mark
--
Mark Rotteveel
> I have a very simple table:If there is a chance that they are updating the same record
>
> CREATE TABLE PARAMS
> (
> ID INTEGER NOT NULL,
> NAME VARCHAR(32) NOT NULL,
> CONSTRAINT PK_PARAMS PRIMARY KEY (ID),
> CONSTRAINT UNQ_PARAMS UNIQUE (NAME)
> );
>
> I have two threads which constantly and at the same time are writing to
> this table:
>
> UPDATE OR INSERT INTO PARAMS (NAME) VALUES(:P_NAME) MATCHING (NAME)
> RETURNING ID;
>
> I've set my transaction parameters like this:
>
> FtraMain.TRParams.Add('isc_tpb_write');
> FtraMain.TRParams.Add('isc_tpb_read_committed');
> FtraMain.TRParams.Add('isc_tpb_wait');
> FtraMain.TRParams.Add('isc_tpb_no_rec_version');
>
> As far as I understand, such configuration should prevent deadlock
> exception to occur. However, deadlock still occurs from time to time:
>
> Deadlock.
> Deadlock.
> Update conflicts with concurrent update.
> Concurrent transaction number is 57258.
concurrently, you will simply get a lock conflict; I don't think there
is a way around this.
Mark
--
Mark Rotteveel