Establishing a separate database connection for the child process

About this task

When your application forks a process, the child process inherits the database connections of the parent. If you leave these connections open, both parent and child processes use the same connection to communicate with the same database server. Therefore, the child process needs to establish a separate database connection.

To establish a separate database connection for the child process:

Procedure

  1. Call sqldetach() to detach the child process from the database server connection in the parent process.
  2. Establish a new connection in the child process (if one is needed).