connections for parent and child process
Posted in 2007
Topics: General Discussion
we use C++ API in our application ( IDS10 UC5 &AIX5.3). We found the connection in parent process must be closed before it spawns a child process (the child process also need connect to DB), otherwise they interrupt each other or just die.... very odd behaviors.. Any idea? Thanks, Frank
Well that's not odd at all. Read the ESQL/C manual (that library underlys the C++ clases), only one thread or task can use a single connection at a time. Multiple threads in the same process either have to pass the connection between them using SET CONNECTION ... DORMANT and CONNECT TO ... so that only one thread at a time uses a connection, or each thread has to open it's own connection. When you spawn a child while connected to the database the two processes are sharing the shared memory structures or the TCP/IP stream or socket of a single connection. Naturally chaos and confusion will reign. Art S. Kagel ----- Original Message ----- From: Frank <ids@iiug.org> At: 2/05 9:39:28 we use C++ API in our application ( IDS10 UC5 &AIX5.3). We found the connection in parent process must be closed before it spawns a child process (the child process also need connect to DB), otherwise they interrupt each other or just die.... very odd behaviors.. Any idea? Thanks, Frank ******************************************************************************* Forum Note: Use "Reply" to post a response in the discussion forum.
We actually had a special OBDC driver mod that allowed multiple threads to be active. It was useful when the OS would only support 1023 sockets. Ken
Please can you explain what do you mean by "....special OBDC driver..."? Is it something specific attributes (connection/statement) being set to serve this purpose OR its altogether different ODBC Driver developed for this specific reason? Thanks -Shesh "Acecpu@aol.com" <Acecpu@aol.com> Sent by: ids-bounces@iiug.org 07/02/2007 02:35 Please respond to ids@iiug.org To ids@iiug.org cc Subject Re: connections for parent and child process [8367] We actually had a special OBDC driver mod that allowed multiple threads to be active. It was useful when the OS would only support 1023 sockets. Ken ******************************************************************************* Forum Note: Use "Reply" to post a response in the discussion forum.