Re: Handling transaction failure due to concurrency errors

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Christopher BROWN <brown(at)reflexe(dot)fr>
Cc: pgsql-jdbc <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Handling transaction failure due to concurrency errors
Date: 2018-03-02 15:21:18
Message-ID: 27574.1520004078@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Christopher BROWN <brown(at)reflexe(dot)fr> writes:
> Thanks for the quick reply. OK for the explanation, and I don't mind
> implementing the retry logic for this case... I just don't know how to
> detect when my code encounters this case (as opposed to other cases that
> can arise, such as unresolved foreign keys when importing data; I don't
> want to get into an infinite retry loop because it will never work in these
> other cases).

Yes, you should only retry in this way for the specific case of a
serialization failure (SQLSTATE 40001).

regards, tom lane

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Christopher BROWN 2018-03-02 15:27:17 Re: Handling transaction failure due to concurrency errors
Previous Message Christopher BROWN 2018-03-02 15:17:09 Re: Handling transaction failure due to concurrency errors