Re: Ecpg and reentrancy

Поиск
Список
Период
Сортировка
От Zeugswetter Andreas SB SD
Тема Re: Ecpg and reentrancy
Дата
Msg-id 46C15C39FEB2C44BA555E356FBCD6FA41EB4D6@m0114.s-mxs.net
обсуждение исходный текст
Ответ на Ecpg and reentrancy  ("Dann Corbit" <DCorbit@connx.com>)
Список pgsql-hackers
> > If (instead) we had a user supplied sqlca, it could be used by multiple
> > threads.
> 
> How do you want to supply it? 

Informix does this:

#else /* IFX_THREAD */
extern long * ifx_sqlcode();
extern struct sqlca_s * ifx_sqlca();
#define SQLCODE (*(ifx_sqlcode()))
#define SQLSTATE ((char *)(ifx_sqlstate()))
#define sqlca (*(ifx_sqlca()))
#endif /* IFX_THREAD */

They use one sqlca per active connection/thread. A connection is basically tied 
to a specific thread. If you want to use the conn in another thread you need 
to:
EXEC SQL SET CONNECTION DORMANT; EXEC SQL SET CONNECTION ...
When using the esql processor, you need to specify which thread package you use
(posix, dce, ...), so they know with which functioncall to get the current 
thread id. Of course this costs, so they have a switch to turn it on (-thread).

Andreas


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Denis Perchine
Дата:
Сообщение: Re: v7.2 rolled last night ...
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: v7.2 rolled last night ...