Skip site navigation (1) Skip section navigation (2)

Re: ECPG still having thread problems on Linux

From: Philip Yarra <philip(at)utiba(dot)com>
To: Lee Kindness <lkindness(at)csl(dot)co(dot)uk>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: ECPG still having thread problems on Linux
Date: 2003-06-26 01:19:09
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackerspgsql-interfaces
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.

In response to


pgsql-hackers by date

Next:From: Alvaro HerreraDate: 2003-06-26 01:28:32
Subject: Re: RServ patch to support multiple slaves (sorta)
Previous:From: Joe ConwayDate: 2003-06-26 01:09:42
Subject: Re: [HACKERS] allowed user/db variables

pgsql-interfaces by date

Next:From: Giorgio PonzaDate: 2003-06-26 09:20:26
Subject: Perl
Previous:From: Nicolás AlvarezDate: 2003-06-25 20:31:50
Subject: postgresql on sco openserver

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group