X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 96306D1CA7D for ; Tue, 16 Dec 2003 01:09:29 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 47587-03 for ; Mon, 15 Dec 2003 21:09:10 -0400 (AST) Received: from candle.pha.pa.us (candle.pha.pa.us [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id 945C4D1D2C6 for ; Mon, 15 Dec 2003 21:09:00 -0400 (AST) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id hBG18i511422; Mon, 15 Dec 2003 20:08:44 -0500 (EST) From: Bruce Momjian Message-Id: <200312160108.hBG18i511422@candle.pha.pa.us> Subject: Re: Possible bug in ECPGlib thread-safety (Postgres In-Reply-To: To: Philip Yarra Date: Mon, 15 Dec 2003 20:08:44 -0500 (EST) Cc: Demetres Pantermalis , pgsql-interfaces@postgresql.org X-Mailer: ELM [version 2.4ME+ PL108 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/35 X-Sequence-Number: 4644 I have updated the 7.4.X does and CVS head docs to mention that ecpg SET CONNECTION is not thread-aware, and I have added this to the ecpg TODO: o Make SET CONNECTION thread-aware --------------------------------------------------------------------------- Philip Yarra wrote: > Hi Demetres, I'm the guy whose emails you quoted below! > > You *must* always use the AT conn_name in a multi-threaded application... > using SET CONNECTION will not work. > > I assume your test results work if you use the thread test application as > included (I wrote it, so I'd be interested to know if it works, as I have > not tested RH9 and SunOS5.8 (though I tested RH7.3 and SunOS2.6) > > Regards, Philip Yarra. > > On Thu, 4 Dec 2003, Demetres Pantermalis wrote: > > > Dear All, > > > > trying to run some tests for the thread-safety of the ecpg library, I > > modified the test_thread.pgc to be like the one attached (test_thread1.pgc). > > > > The changes are as follows: > > 1) All the connections used for insertions, begin in main function (and not > > inside each thread) > > 2) The statement "EXEC SQL SET CONNECTION followed by the inserts is > > used, instead of the"EXEC SQL AT ..." statement. > > 3) A new line for ECPGlog was added. > > > > The results of executing the code are unexpected. Either a core dump > > results, or one of the two threads inserts the rows in the table and the > > process never returns to OS prompt, while the other thread seems to insert > > the rows, but never commits. > > > > A log file produced by ECPGlog is also attached. > > > > Platforms tested: SunOS 5.8 and Linux RH9 (with the same results) > > > > Any suggestions appreciated. > > > > PS. I've found out that somebody else had about the same problem, but that > > was during testing phase and I assumed that it could have been solved by > > now. The links found are: > > http://archives.postgresql.org/pgsql-hackers/2003-06/msg00513.php > > http://archives.postgresql.org/pgsql-hackers/2003-06/msg00792.php > > > > Demetres Pantermalis > > Intracom SA > > Network Support Systems. > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster > -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073