Re: ECPG and multiple threads - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: ECPG and multiple threads
Date
Msg-id 20061110141904.GA17052@svana.org
Whole thread Raw
In response to ECPG and multiple threads  ("Adam" <adam.ciazynski@gmail.com>)
List pgsql-general
On Fri, Nov 10, 2006 at 12:23:19AM -0800, Adam wrote:
> Hi,
>
> I'm porting an embedded-SQL application to PostgreSQL so embedded sql
> is a must for me. My application is multi-threaded. SQL queries are
> used by several threads. The program keeps terminating unexpectedly in
> deemingly "innocent" places.

Note, you might be able to make ECPG and libpq thread-safe, however
even then you *cannot* use the same connection simultaneously from
different threads. You will have to open a new connection for each
parallel connection you want to handle. Or use locking.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment

pgsql-general by date:

Previous
From: Teodor Sigaev
Date:
Subject: Re: tsearch2() with data from other table
Next
From: Alvaro Herrera
Date:
Subject: Re: AutoVacuum on demand?