X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 303DA30EAD9 for ; Thu, 26 Jun 2003 01:19:25 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 39057-06 for ; Wed, 25 Jun 2003 22:19:14 -0300 (ADT) Received: from cpc-gw2.cpc.net.au (unknown [210.9.248.93]) by svr1.postgresql.org (Postfix) with ESMTP id 8934530FD5F for ; Wed, 25 Jun 2003 22:19:12 -0300 (ADT) Received: from utiba.com by Utiba Mail Gateway (2.2.2) with ESMTP id h5Q1JC830464; Thu, 26 Jun 2003 11:19:12 +1000 Received: from pc37.cpc.net.au (pc37.cpc.net.au [192.168.0.37]) by Utiba Mail Thingy (0.0.2) with ESMTP id h5Q1JAx18491; Thu, 26 Jun 2003 11:19:10 +1000 Content-Type: text/plain; charset="iso-8859-1" From: Philip Yarra Organization: Utiba To: Lee Kindness Subject: Re: ECPG still having thread problems on Linux Date: Thu, 26 Jun 2003 11:19:09 +1000 User-Agent: KMail/1.4.3 Cc: pgsql-interfaces@postgresql.org References: <200306241825.32527.philip@utiba.com> <16121.27884.841077.431930@kelvin.csl.co.uk> In-Reply-To: <16121.27884.841077.431930@kelvin.csl.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200306261119.09242.philip@utiba.com> X-Archive-Number: 200306/75 X-Sequence-Number: 4286 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=20 problem lay in the fact that the preproc was outputting NULL as the=20 connection name, but was unsure why. Your changes allowed both threads to= =20 complete their inserts, which is great news for us! I'll add that "AT" clause to my list of updates for the documentation - it= =20 might be important. It's kinda.... absent... from the manual.=20 I might also add a section on using pthreads with ECPG, since people portin= g=20 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 occurri= ng=20 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=20 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 star= t=20 porting our apps to Postgres in earnest. Regards, Philip.