Re: BEGIN strange behaviour

From: "Francesco Esposito" <francesco(dot)esposito(at)notorand(dot)it>
To: luca(dot)ciciriello(at)email(dot)it
Cc: pgsql-general(at)postgresql(dot)org, alessandra(dot)autunno(at)galileoavionica(dot)it
Subject: Re: BEGIN strange behaviour
Date: 2007-11-22 13:35:14
Message-ID: df01f0600711220535w6fcc94eer61a7efeb6b6440cb@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dear luca,
libpq is reentrant and thread-safe if the configure command-line option
--enable-thread-safety has been used when the PostgreSQL distribution was
built. In addition, you might need to use additional compiler command-line
options when you compile your application code. Refer to your system's
documentation for information about how to build thread-enabled
applications.

One restriction is that no two threads attempt to manipulate the same PGconn
object at the same time. In particular, you cannot issue concurrent commands
from different threads through the same connection object. (If you need to
run concurrent commands, start up multiple connections.)

Could you check these points?

BR,
Francesco

2007/11/22, luca(dot)ciciriello(at)email(dot)it <luca(dot)ciciriello(at)email(dot)it>:
> Hi All.
> I've sperimented a strange behaviour using the command BEGIN and COMMIT in
a
> multi-threaded Linux environment.
> In one of the two thread I use I've got the following message after
> PQexec(myconn, "BEGIN;");
>
> WARNING: there is already a transaction in progress
>
> And after the command PQexec(myconn, "COMMIT;"); (always in the same
> thread)
>
> I've got the message
>
> WARNING: there is no transaction in progress.
>
> After these warnings the elaboration is freezing when the next PQexec is
> encoutered.
>
> I have the same behaviour even if the second thread is operating on a
> different table than the first thread.
>
> The same commands (inside the same code) runs fine in Windows and in MacOS
> X.
>
> Any Idea?
>
> Thanks in advance.
>
> Luca.
>
>
>
> --
> Email.it, the professional e-mail, gratis per te: http://www.email.it/f
>
> Sponsor:
> Prova 1bitmore Newsletter il servizio per creare newsletter in modo
> semplice e veloce, senza bisogno di conoscenze di grafica o di
> programmazione.
> Gratis per 30 giorni!
>
> Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=7243&d=20071122
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org/
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message luca.ciciriello 2007-11-22 13:43:02 Re: BEGIN strange behaviour
Previous Message Andrew Sullivan 2007-11-22 13:28:25 Re: BEGIN strange behaviour