Re: Multi-threaded ESQL/C & connections
Posted in 1999
Willem Roos wrote: > > Hi all, > > It says in the manual (ESQL/C 7.2 Prog Manual, p 11-19) that many > threads can have *active* connections but only one thread has the > *current* connection. Does this mean that actual selecting/retrieving > rows from the database is serialized in a multi-threaded application? If > so, how does one set a connection current. > > I've grasped the dormant vs. active connection thingie, but the active > vs. current is currently beyond me. NO! Each active connection is current for the thread that activated it. I think you have read the language backwards. It is just saying that each connection can only be the current connection for one thread at a time and conversely each thread can only have one current connection. Quoting from the SDK 2.01 (ESQL/C 9.13) manual p13-18: The current connection is the active database server connection that is currently sending SQL requests to, and possibly receiving data from, the database server. A single-threaded application has only one current (or active) connection at a time. In a multithreaded application, each thread could have a current connection. Thus a multithreaded application could have multiple active connections simultaneously. Art S. Kagel