Re: Handling transaction failure due to concurrency errors

From: Christopher BROWN <brown(at)reflexe(dot)fr>
To: jwhiting(at)redhat(dot)com
Cc: pgsql-jdbc <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Handling transaction failure due to concurrency errors
Date: 2018-03-08 11:08:57
Message-ID: CAHL_zcNiKoNKjqE9mPPUd1JXTV7dTQ--B2Uxt3Z37TWcjuBOGQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi Jeremy,

Thanks for the suggestion, trying out Byteman was already on my TODO list
for other cases, and it could be handy here too.

​Thanks,

Christopher

On 8 March 2018 at 11:59, <jwhiting(at)redhat(dot)com> wrote:

> Hi Christopher,
> On a side note you should look at the Byteman project. Byteman makes
> fault injection for testing purposes very easy.
>
> http://byteman.jboss.org/
>
> In your case using Byteman gets round the effort involved to precisely
> re-create a failure scenario. Testing when your re-try logic kicks in
> (or not).
>
> Jeremy
>
> On Fri, 2018-03-02 at 16:27 +0100, Christopher BROWN wrote:
> > Tom,
> >
> > That's what I was looking for, so thanks, I'll give it a go.
> >
> > Best regards,
> > Christopher
> >
> >
> >
> > On 2 March 2018 at 16:21, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> > > 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

Browse pgsql-jdbc by date

  From Date Subject
Next Message Vladimir Sitnikov 2018-03-08 13:06:57 [pgjdbc/pgjdbc] 1ca0c5: fix: support insert ... on conflict...update for r...
Previous Message jwhiting 2018-03-08 10:59:32 Re: Handling transaction failure due to concurrency errors