Re: Postgres 8.3.5 - ECPG and the use of descriptors and cursors in multi-threaded programs

From: Bosco Rama <postgres(at)boscorama(dot)com>
To: Leif Jensen <leif(at)crysberg(dot)dk>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Postgres 8.3.5 - ECPG and the use of descriptors and cursors in multi-threaded programs
Date: 2011-06-01 00:35:42
Message-ID: 4DE5895E.4060004@boscorama.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Leif Jensen wrote:
>
> Thank you for your comment. Yes, it would be nice to get some more
> comments on the allocate/deallocate on a connection issue.
>
> I have verified that in my case deallocating a prepared statement,
> it guesses the wrong connection and returns an error. (The right
> one is doing auto-deallocation at disconnect time, though).
>
> However, I just noticed that allocating a descriptor with the "AT
> <connection>" clause,
> EXEC SQL AT :_thisDbConn ALLOCATE DESCRIPTOR :descname;
> generates an ECPGallocate_desc() call without any connection name and
> that this can "screw up" the ECPGget_desc() function when guessing a
> connection. I could of course use:
> EXEC SQL SET CONNECTION <connection name>;
> before the allocate, but that would need mutex's all over to make sure
> that other threads will not set the connection too.
>
> Any idea why the ecpg pre-compiler doesn't use the named connection
> for the ALLOCATE DESCRIPTOR statement even though it allows it ?

Unfortunately, like you, I am just a user of this wonderful DB. Since
we are not seeing any other input here on the 'general' list it may be
time to move this thread to the pgsql-interfaces list. Are you subscribed
to it? It is a very low bandwidth list but it does tend to highlight the
interface issues distinct from the general DB discussions.

BTW, your PG install is 10 'point' releases behind the current release for
the 8.3.x branch. While I am at 8.4.7 (one point release behind) I seem to
be seeing a similar set of issues and nothing in the 8.4.8 change-list says
anything about ecpg.

Bosco.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message jlhgis 2011-06-01 01:17:13 Re: troubles with initdb
Previous Message Craig Ringer 2011-06-01 00:14:24 Re: troubles with initdb