pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Philip Yarra <philip@utiba.com>
To: Lee Kindness <lkindness@csl.co.uk>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: ECPG still having thread problems on Linux
Date: Thu, 26 Jun 2003 11:19:09 +1000
Message-ID: <200306261119.09242.philip@utiba.com> (raw)
In-Reply-To: <16121.27884.841077.431930@kelvin.csl.co.uk>
References: <200306241825.32527.philip@utiba.com>
	<16121.27884.841077.431930@kelvin.csl.co.uk>

On Wed, 25 Jun 2003 07:35 pm, Lee Kindness wrote:
> Philip, both your SELECTs are using the same database connection (and
> it's undefined which one it is) without any locking. You need to add
> "AT clauses" to specify an explicit connection. See attached diff.

Ah, that'd be it. I spent some time debugging last night, and I'd realised the 
problem lay in the fact that the preproc was outputting NULL as the 
connection name, but was unsure why. Your changes allowed both threads to 
complete their inserts, which is great news for us!

I'll add that "AT" clause to my list of updates for the documentation - it 
might be important. It's kinda.... absent... from the manual. 

I might also add a section on using pthreads with ECPG, since people porting 
from Informix or Sybase might require such info up front.

> However, i've not tried it... I'll try and get some time!

That'd be great if you could... there appears to still be a problem occurring 
at "EXEC SQL DISCONNECT con_name". I'll look into it tonight if I can.

All this does kinda raise the interesting question of why it worked at all on 
FreeBSD... probably different scheduling and blind luck, I suppose.

Thanks for the reponse - I'm a happy man. By 7.4, we should be able to start 
porting our apps to Postgres in earnest.

Regards, Philip.



view thread (3+ messages)

Message-ID: <200306261119.09242.philip@utiba.com>
Permalink:  ../200306261119.09242.philip@utiba.com/
Also on:    postgresql.org/message-id/200306261119.09242.philip@utiba.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 using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: philip@utiba.com, lkindness@csl.co.uk
  Subject: Re: ECPG still having thread problems on Linux
  In-Reply-To: <200306261119.09242.philip@utiba.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