ID: 33184 Updated by: [EMAIL PROTECTED] Reported By: brad_allgood at csgsystems dot com Status: Open Bug Type: ODBC related Operating System: Windows XP PHP Version: 5.0.4 New Comment:
Brad: 1) Can you reproduce the error with the PECL ibm_db2 extension? You can grab the php_ibm_db2.dll from http://snaps.php.net/, change odbc_* to db2_* in your function calls (with the exception of odbc_connect() -- I think you'll need to add USER=user;PASSWORD=password; to your connection string and pass nulls for the second and third parameter), and everything _should_ work. Note that this requires a minimum of DB2 V8.2. 2) What levels of DB2 are you running on your Windows box and AIX server? Previous Comments: ------------------------------------------------------------------------ [2005-05-30 20:24:07] brad_allgood at csgsystems dot com Okay ... I'm inlcuding a script written and tested on my machine to reproduce the error: //################## Script Start ######################## <?php $b_date = '05/25/2005'; $b_time = '09:00:00'; $m_mach_sn = "075-21752"; $connect_string = "Driver={IBM DB2 ODBC Driver};HOSTNAME=host.domain.com;DATABASE=TEST;PROTOCOL=TCPIP;PORT=50000;"; $conn = odbc_connect($connect_string, 'user', 'password'); $counter=0; while ($counter <5000) { $vpcfg_qry = "select distinct m_mach_sn, m_cluster_n, m_card_num, m_lss_la, m_array_id, m_loop_id, m_grp_num, m_disk_num from db2inst1.vpcfg where m_mach_sn = '$m_mach_sn' order by m_mach_sn, m_card_num, m_cluster_n, m_loop_id, m_grp_num "; // Get Result $vpcfg_result = odbc_exec($conn,$vpcfg_qry); //print "m_mach_sn|m_cluster_n|m_card_num|m_lss_la|m_array_id|m_loop_id|m_grp_num|m_disk_num|m_dbl_wide<br>\n"; // Get Data From Result $vpcfg_row_count = 0; while ($vpcfg_row[] = odbc_fetch_array($vpcfg_result)) { $m_mach_sn = $vpcfg_row[$vpcfg_row_count]["M_MACH_SN"]; $m_cluster_n = $vpcfg_row[$vpcfg_row_count]["M_CLUSTER_N"]; $m_card_num = $vpcfg_row[$vpcfg_row_count]["M_CARD_NUM"]; $m_lss_la = $vpcfg_row[$vpcfg_row_count]["M_LSS_LA"]; $m_array_id = $vpcfg_row[$vpcfg_row_count]["M_ARRAY_ID"]; $m_loop_id = $vpcfg_row[$vpcfg_row_count]["M_LOOP_ID"]; $m_grp_num = $vpcfg_row[$vpcfg_row_count]["M_GRP_NUM"]; $m_disk_num = $vpcfg_row[$vpcfg_row_count]["M_DISK_NUM"]; } print "Counter = $counter\n"; $counter = $counter + 1; } odbc_close($conn) ?> //################## Script End ######################## ------------------------------------------------------------------------ [2005-05-30 19:48:52] denials at gmail dot com What is the expected result of the test script? In reading the script (and ignoring the extra close brace in line 4 that would cause a syntax error), I would expect the loop to start issuing errors after the first iteration, as odbc_close_all() should close the connection if no transactions are in progress. Given the subject of the bug, I'm assuming you're seeing an SQL0954C instead, which would indicate that odbc_close_all() is not, in fact, doing its job. However, I have been unable to reproduce this result on Windows XP, Apache 2.0.52, PHP 5.0.4, DB2 Version 8.2 connecting locally or to a remote DB2 server on a Linux box. The APPLHEAPSZ setting on the Windows server is the default of 256 4K pages. ------------------------------------------------------------------------ [2005-05-30 16:08:11] brad_allgood at csgsystems dot com I do not think this is a db related issue as I can run the same query from the command line on the server running the db and it works fine. I cut and pasted the original bug report as I thought this may have been overlooked in the php5 development cycle. I am running the php script on a windows xp machine using odbc calls against a remote db2 machine using an explict connection string call. $connect_string = "Driver={IBM DB2 ODBC Driver};HOSTNAME=host.domain.com;DATABASE=SOMEDB;PROTOCOL=TCPIP;PORT=X0000;"; ------------------------------------------------------------------------ [2005-05-30 15:29:25] [EMAIL PROTECTED] SQL0954C Not enough storage is available in the application heap to process the statement. Explanation: All available memory for the application has been used. The statement cannot be processed. User Response: Terminate the application on receipt of this message. Increase the database configuration parameter (applheapsz) to allow a larger application heap. ------------------------------------------------------------------------ [2005-05-30 15:17:32] brad_allgood at csgsystems dot com Description: ------------ Appears to be a resurface of bug id #16221 from 4.1.2 After doing between 50-182 query's to IBM DB2 7 on Windows 2000 (localhost) with this script: <? $connection = odbc_connect( "test","db2admin", "admin" ) or die("Unable to connect to SQL server"); } $result=odbc_exec($connection,"set current sqlid = 'DB2ADMIN'"); $counter=0; while ($counter <5000) { $query="select * from tms_user"; $result=odbc_exec($connection,$query); $temp=odbc_fetch_row ($result); echo "counter= $counter <br>"; odbc_free_result($result); odbc_close_all(); $counter++; } ?> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=33184&edit=1