
> > 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

Tue, 5 Feb 2002 16:00:01 +0100
"Zeugswetter Andreas SB SD" <ZeugswetterA@spardat.at>
Re: Ecpg and reentrancy