Oracle connections and forking processes

From: Charles C Thain <cthain_at_web.de>
Date: 20 Jun 2001 03:30:58 -0700
Message-ID: <4315caec.0106200230.578a72c_at_posting.google.com>


Hi all,

We currently have a problem with a system that spawns several proceses using fork() and then accessing an Oracle database from all of these processes (via SQL*Net). Now, I am aware that forking while being connected to Oracle could cause severe problems - what with the shared shadow process and all. But we thought we had managed to avoid these problems by not using the original connection in the spawned processes. This worked fine with Oracle 8.1.5. Now the system has been installed on a server using 8.1.6 and we suddenly get the error 3113 "end of communication channel". Here is what is happening:

First we have a master process. This process opens a connection to the Oracle database. It now does a couple of queries to determine the optimal distribution of the work that has to be carried out. The master process then spawns 4 slave processes using fork to actually carry out the task. Now, at this point we have a common connection for all 5 processes. _But_ we made sure that the spawned processes don't use or close the connection inherited from the master process. Instead, each slave opens its own connection and uses that.

The master process however still uses the original connection to query the database for status information stored there by the slaves. We had envisioned that this would work flawlessly since no connection is actually used commonly by more than one process. And, voila, on Oracle 8.1.5 we never had a problem.

On 8.1.6, the first access by the master process to the Oracle database after it has spawned the slaves, leads to the above mentioned error 3113 "end of communication channel".

Has anyone else ever used a multi-process setup and ran into the same problems? We are especially worried that such a change in behavior would occur between 8.1.5 and 8.1.6, since it seems kind of drastic.

Any feedback would be greatly appreciated, as we are currently at a loss.

Regards,
Charles Received on Wed Jun 20 2001 - 12:30:58 CEST

Original text of this message