Re: Pro*C Question: Forking Processes

From: Brian P. Mac Lean <brian.maclean_at_teldta.com>
Date: 1996/08/29
Message-ID: <3226062D.33E9_at_teldta.com>#1/1


Frank-Michael Zimmer wrote:
>
> Well, while I'm at it:
>
> I have a serious program with a Pro*C program that is to connect to the
> database, and then fork via the unix system call.
> Does anybody know what _exactly_ will happen, especially if one of the
> processes terminates while the other one is to keep on running?
> I have experienced the strangest effects, like pipes misteriously
> refilling themselves, even if they have been emptied _before_ the fork,
> and other strangenesses...
>
> Well, here's a problem to earn you the title "Oracle Guru"... ;)
>
> Thanks,
> Frank-Michael Zimmer

I don't think you should be connecting to the db prior to the fork. Logically it's not sound so I have always avoided it. If it's necessary to connect then fork, do a connect/disconnect/fork/connect parent & child. To disconnect I believe (and the sql documentation states) you use "EXEC SQL COMMIT WORK RELEASE;"

Oracle 7.3 OCI supports threads with multiple connections but without a working example I bet it would be a nightmare to develop.

I see by your other posting in this group that you are having trouble with the "EXEC SQL COMMIT WORK RELEASE;" statement which in effect is related to my response here. Do you have any information on return codes after the commit and after the reconnect. Just an idea....can you slip a "select 'x' from dual;" statement into a test version of the program between the commit and reconnect and see what error code is returned?

Good luck and I'm looking forward to hearing the solution.

                       \\|//
                       (0-0)
           +-----oOO----(_)-----------+
           | Brian P. Mac Lean        |
           | Database Analyst         |
           | brian.maclean_at_teldta.com |
           | http://www.teldta.com    |
           +-------------------oOO----+
                      |__|__|
                       || ||
                      ooO Ooo
Received on Thu Aug 29 1996 - 00:00:00 CEST

Original text of this message