|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-07-18 13:05 UTC] alfred dot trapp at tvi-services dot de
Description:
------------
We have an application currently running without problems (Fedora 3 + PHP 4.3.3(from source) + apache 1.3.33(from source) + Oracle Client 9.2 oci8).
Now we have tested php 5.0.4 with Oracle Client 9.2 / 10.1 connecting to an Oracle 9.2 Database with either ocilogon, ocinlogon and ociplogon making around 500 INSERTS in a loop. On database side we get a so called Oracle Session Explode
while inserting, doing around 30 inserts with data and the rest are empty INSERTS without any (NULL) values. Actually there are around 50 Oracle Sessions opened, most of them without any data (detected with PL/SQL-Developer from Allround Automations).
Also we get >>Number of Sessions exceeded<< from the Database.
On the productive version with php 4.3.3 we have one Oracle Session with all 500 rows full of correct data inserted.
Reproduce code:
---------------
Configure Command
'./configure' '--build=i686-redhat-linux-gnu' '--host=i686-redhat-linux-gnu' '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--with-apxs2' '--disable-rpath' '--with-bz2' '--with-curl' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-expat-dir=/usr' '--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--with-pear=/usr/share/pear' '--with-kerberos' '--enable-ucd-snmp-hack' '--with-unixODBC=shared,/usr' '--enable-memory-limit' '--enable-shmop' '--enable-calendar' '--enable-dbx' '--enable-dio' '--with-oci8=/db/oracle/product/10.1/client' '--with-mime-magic=/usr/share/file/magic.mime' '--without-sqlite' '--with-libxml-dir=/usr' '--with-xml' '--with-apxs2=/usr/sbin/apxs' '--without-mysql' '--without-gd' '--without-odbc' '--disable-dom' '--disable-dba'
Program Code
$connection=ocilogon($g_tvp_user, $g_tvp_pw, $g_tvp_sid);
$tabellenname="ERGEBNISSE_".$_SESSION['tvipilot']['user_id'];
for($i=0;$i<count($a_feldwerte);$i++){
if($a_feldwerte[$i]!="''" && $a_feldwerte[$i]){
$queryinsert="INSERT INTO $tabellenname (".$tabinsert.") VALUES (".$a_feldwerte[$i].")";
$stmt=ociparse($connection,$queryinsert);
if(true!=ociexecute($stmt)){
$dateiname="log/statement".$_SESSION['tvipilot']['user_id']."_".$_SESSION['tvipilot']['arbeitsprofil']."_".$_SESSION['tvipilot']['darstellungsprofil'].".log";
$fh_rs=fopen($dateiname,"a");
if (!fwrite($fh_rs, $queryinsert."\n")) {
print ("Kann in die Datei $dateiname nicht schreiben\n");
}
fclose($fh_rs);
}
unset($queryinsert);
}
}
ocifreestatement($stmt);
ocilogoff($connection);
php.ini Modifications
max_execution_time = 600
max_input_time = 300
memory_limit = 128M
extension_dir = "/usr/lib/php/modules"
Expected result:
----------------
One Oracle Session with all 500 rows full of correct data inserted.
Actual result:
--------------
On database side we get a so called Oracle Session Explode
while inserting, doing around 30 inserts with data and the rest are empty INSERTS without any (NULL) values. Actually there are around 50 Oracle Sessions opened, most of them without any data (detected with PL/SQL-Developer from Allround Automations).
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 06:00:01 2025 UTC |
Hi tony Simplified Program Code $connection=ocilogon($user, $pwd, $sid); $tablename="RESULT_".$user; for($i=0;$i<count($result);$i++){ $queryinsert="INSERT INTO $tablename (".$tabinsert.") ". "VALUES (".$result[$i].")"; $stmt=ociparse($connection,$queryinsert); ociexecute($stmt); unset($queryinsert); } ocifreestatement($stmt); ocilogoff($connection); u'r welcome$connection=ocilogon($user, $pwd, $sid); $tablename="RESULT"; for($i=0;$i<count($result);$i++){ $queryinsert="INSERT INTO $tablename (film_id, sendungs_id, s_id , intra_anfangszeit, akt_anfangszeit, sender,titel,bew,gt,texte,bild,sparte,stnr,genre) VALUES (".$result[$i].")"; $stmt=ociparse($connection,$queryinsert); ociexecute($stmt); unset($queryinsert); } and $result is a dynamically filled array from another resource. The wanted restriction was >>not more than 20 lines of code<<. If you want to know how the result array gets filled, i have to send you the whole script.