pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adriaan Joubert <a.joubert@albourne.com>
To: pgsql-jdbc@postgresql.org
Subject: Re: [JDBC] currval() race condition on server? 
Date: Tue, 24 Oct 2006 17:20:04 +0100
Message-ID: <20061024162004.3e08f577@mailhost.albourne.com> (raw)

 

  There is no "timing issue" in currval --- the server is single-threaded
  and it's simply not possible that currval wouldn't be aware of a
  previous nextval.Thanks! That is good to know, as it makes clear that the problem is elsewhere!

  
  The theory that sounds best to me is the one someone already mentioned
  about your trigger having a code path that doesn't execute nextval.
  Another straw to grasp at is connection pooling: are you using it,
  if so is it conceivable that the SELECT is being issued on a different
  connection than the UPDATE?
  Yes, I am using a connection pool, but from the jdbc log it looks as if both statements are executed in a single trip to the backend, so this leaves the trigger. Best guess, as you say, is that there is an error condition somewhere in the trigger so that nextval is not executed. I'll have another close look at the trigger code - it was written 6-7 years ago and only patched up for the new protocol version and to add the macros required in 8.2, so it could do with a good going over.

Thanks to everybody for all the help!

Adriaan

    

view thread (12+ messages)

Message-ID: <20061024162004.3e08f577@mailhost.albourne.com>
Permalink:  ../20061024162004.3e08f577@mailhost.albourne.com/
Also on:    postgresql.org/message-id/20061024162004.3e08f577@mailhost.albourne.com

 · 

reply

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: a.joubert@albourne.com
  Subject: Re: [JDBC] currval() race condition on server?
  In-Reply-To: <20061024162004.3e08f577@mailhost.albourne.com>
  References: <20061024162004.3e08f577@mailhost.albourne.com>

* 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