From: Tom Lane <tgl@sss.pgh.pa.us>
To: Christopher BROWN <brown@reflexe.fr>
Cc: pgsql-jdbc <pgsql-jdbc@postgresql.org>
Subject: Re: Handling transaction failure due to concurrency errors
Date: Fri, 02 Mar 2018 10:21:18 -0500
Message-ID: <27574.1520004078@sss.pgh.pa.us> (raw)
In-Reply-To: <CAHL_zcMGYqbVBftasJb5GQOVtzjy94RHnJfjA5YkAtGNjUE7Cw@mail.gmail.com>
References: <CAHL_zcOcnBhHhbLenk0xt43i2v8sO6C5RX2ntVMErbKDc+cuWw@mail.gmail.com>
<26956.1520003407@sss.pgh.pa.us>
<CAHL_zcMGYqbVBftasJb5GQOVtzjy94RHnJfjA5YkAtGNjUE7Cw@mail.gmail.com>
Christopher BROWN <brown@reflexe.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: tgl@sss.pgh.pa.us, brown@reflexe.fr
Subject: Re: Handling transaction failure due to concurrency errors
In-Reply-To: <27574.1520004078@sss.pgh.pa.us>
References: <CAHL_zcOcnBhHhbLenk0xt43i2v8sO6C5RX2ntVMErbKDc+cuWw@mail.gmail.com> <26956.1520003407@sss.pgh.pa.us> <CAHL_zcMGYqbVBftasJb5GQOVtzjy94RHnJfjA5YkAtGNjUE7Cw@mail.gmail.com> <27574.1520004078@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox