ID: 33994 User updated by: greatwhitepine at bigfoot dot com Reported By: greatwhitepine at bigfoot dot com Status: Wont fix Bug Type: Ingres II related Operating System: Tru64 UNIX V5.1B (Rev. 2650) PHP Version: 5.0.4 New Comment:
Seperate connections does not work (as per the example)! Previous Comments: ------------------------------------------------------------------------ [2005-08-04 08:45:38] [EMAIL PROTECTED] Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Use separate connections or something else than ingres (moved to PECL, report bugs on it to pecl.php.net/bugs..) ------------------------------------------------------------------------ [2005-08-04 08:14:13] greatwhitepine at bigfoot dot com Sorry, forgot the pcntl_waitpid during my 1st edit (see below). ingres_connect($str_database, $str_username, $str_password); if (ingres_query('select count(*) from auto_ldg_run')) { print 'db ok during fork'."\n\n"; } $int_pid = pcntl_fork(); if(!$int_pid) { ingres_connect($str_database, $str_username, $str_password); if (ingres_query('select count(*) from auto_ldg_run')) { print 'db ok for child'."\n\n"; } exit(); } pcntl_waitpid ($int_pid, $str_status); ingres_connect($str_database, $str_username, $str_password); if (!ingres_query('select count(*) from auto_ldg_run')) { print 'db not ok after fork'."\n\n"; } exit(1); ------------------------------------------------------------------------ [2005-08-04 08:03:06] greatwhitepine at bigfoot dot com Description: ------------ As per the manual ingres_connect connections are terminated when the process exits. When a forked child exits the connection is terminated permanently until the parent process is restarted. Reproduce code: --------------- ingres_connect($str_database, $str_username, $str_password); if (ingres_query('select count(*) from table')) { print 'db ok during fork'."\n\n"; } $int_pid = pcntl_fork(); if(!$int_pid) { ingres_connect($str_database, $str_username, $str_password); if (ingres_query('select count(*) from table')) { print 'db ok for child'."\n\n"; } exit(); } ingres_connect($str_database, $str_username, $str_password); if (!ingres_query('select count(*) from table')) { print 'db not ok after fork'."\n\n"; } Expected result: ---------------- db ok during fork db ok for child Actual result: -------------- db ok during fork db ok for child Warning: ingres_query(): Ingres II: Server or API error : Read from peer process failed; it may have exited. in /home/its/autoldg/lib/php/local/lib_autoldg_daemon.php on line 228 Warning: ingres_query(): Ingres II: SQLSTATE : 08004 in /home/its/autoldg/lib/php/local/lib_autoldg_daemon.php on line 228 db not ok after fork Warning: Unknown: Ingres II: Server or API error : API function cannot be called in the current state. in Unknown on line 0 Warning: Unknown: Ingres II: SQLSTATE : 5000R in Unknown on line 0 Warning: Unknown: Ingres II: Unable to close statement !! in Unknown on line 0 Warning: Unknown: Ingres II: Unable to rollback transaction !! in Unknown on line 0 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=33994&edit=1
