RE: Reconnect a single connection used by multiple threads in embedded SQL in C application causes error. - Mailing list pgsql-bugs

From egashira.yusuke@fujitsu.com
Subject RE: Reconnect a single connection used by multiple threads in embedded SQL in C application causes error.
Date
Msg-id TYWPR01MB72023E15214B3EF77D53D0A3FF3E9@TYWPR01MB7202.jpnprd01.prod.outlook.com
Whole thread Raw
In response to Re: Reconnect a single connection used by multiple threads in embedded SQL in C application causes error.  (Noah Misch <noah@leadboat.com>)
Responses RE: Reconnect a single connection used by multiple threads in embedded SQL in C application causes error.  ("egashira.yusuke@fujitsu.com" <egashira.yusuke@fujitsu.com>)
List pgsql-bugs
Hi Noah,

> Would you like to propose a patch?

Sure. I will work on creating a document patch.

However, I found another problem while testing to make sure that the use cases were valid.

>      - Each thread does its own CONNECT, DISCONNECT, and other commands.
>        Each thread has its own default connection. No sharing at all."

In that case, if I execute CONNECT with same connection-string on each threads without connection-name, the later
CONNECTwas skipped. 
Then, ECPGdebug shows following message.

  ECPGconnect: connection identifier (null) is already in use

This seems to indicate that CONNECT need to specify connection-name even if we use the default connection in each
thread.
This also seems to me to be an undesirable behavior in multiple thread.
Or do we need to name all connections if we use multiple connections, even in multiple thread?


Regards,
Yusuke Egashira




pgsql-bugs by date:

Previous
From: Kyotaro Horiguchi
Date:
Subject: Re: Wal sender process not moving past wait_event_type: IO and wait_event: WALRead
Next
From: Mark Murawski
Date:
Subject: Re: Bug plperl.c