Skip Menu |

This queue is for tickets about the DBD-DB2 CPAN distribution.

Report information
The Basics
Id: 57614
Status: resolved
Priority: 0/
Queue: DBD-DB2

People
Owner: Nobody in particular
Requestors: gsorense [...] us.ibm.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



CC: Lalethia Bethea <lalethia [...] us.ibm.com>, Julius Raneses <jraneses [...] us.ibm.com>, Thomas Wizda <twizda [...] us.ibm.com>, Ray Barrera <pnkfloyd [...] us.ibm.com>, Nishu Priya <nishu.priya [...] in.ibm.com>, Judith Kidd <judykidd [...] us.ibm.com>
Subject: INNER and OUTER $sth and finish is terminating all stat
Date: Tue, 18 May 2010 17:26:04 -0500
To: opendev [...] us.ibm.com, bug-DBD-DB2 [...] rt.cpan.org
From: Greg Sorensen <gsorense [...] us.ibm.com>
Hi, I'm involved with moving our application from AIX to zLinuz and we have encountered a problem where the finish() routine either indirect or directly seems to terminate all statement handles in the program. We need help understanding if this is a bug that can be fixed or maybe how to correct this behavior. Our original system on AIX did not see this problem. web@godzilla:/perl_modules> db2level DB21085I Instance "bcimp" uses "64" bits and DB2 code release "SQL09055" with level identifier "06060107". Informational tokens are "DB2 v9.5.0.5", "s091123", "MI00318", and Fix Pack "5". Product is installed at "/opt/ibm/db2/V9.5". DBD::DB2 is $VERSION = '1.78'; $DBI::VERSION = "1.609"; Perl is version 5.12 Summary of my perl5 (revision 5 version 12 subversion 0) configuration: Platform: osname=linux, osvers=2.6.16.60-0.42.9-default, archname=s390x-linux uname='linux godzilla 2.6.16.60-0.42.9-default #1 smp thu jan 28 23:39:37 utc 2010 s390x s390x s390x gnulinux ' config_args='' hint=recommended, useposix=true, d_sigaction=define useithreads=undef, usemultiplicity=undef useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=define, use64bitall=define, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='gcc', ccflags ='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O2', cppflags='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include' ccversion='', gccversion='4.1.2 20070115 (SUSE Linux)', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=87654321 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='gcc', ldflags =' -fstack-protector -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib /lib64 /usr/lib64 /usr/local/lib64 libs=-lnsl -lndbm -lgdbm -ldl -lm -lcrypt -lutil -lc -lgdbm_compat perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc libc=/lib/libc-2.4.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.4' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector' Characteristics of this binary (from libperl): Compile-time options: PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP USE_64_BIT_ALL USE_64_BIT_INT USE_LARGE_FILES USE_PERLIO USE_PERL_ATOF Here is an example: We have an "OUTER" loop and "INNER". $stmt="select c.custno,c.cname,c.dac,n.notes,n.hot_issues from $schema.v4_cust c, $schema.v4_cust_notes n where c.group = '$group' and c.group=n.group and c.custno=n.custno and c.custno='$custno' order by c.cname" if ( $custno ); print "$stmt<br>"; $sth=$dbh->prepare($stmt); $sth->execute(); while( @ary = $sth->fetchrow() ) { $stmt_sub="select t.tsm_name,c.type,t.ph_tl,t.email from $schema.v4_tsm_cfg t, $schema.v4_cust_tsm c where c.custno='$ary[0]' and c.group='$group' and t.retain_id=c.retain_id and c.type in ('p','s') and c.group=t.group"; $sth_sub=$dbh->prepare($stmt_sub); $sth_sub->execute(); while(@sub_ary = $sth_sub->fetchrow() ) { $pri="$sub_ary[0] $sub_ary[2] $sub_ary[3]" if ( $sub_ary[1] =~ /^p/ ); $sec="$sub_ary[0] $sub_ary[2] $sub_ary[3]" if ( $sub_ary[1] =~ /^s/ ); } $sth_sub->finish(); } $sth->finish(); ---------------------------------------------------- With tracing diagnostics we have the following output showing pre-mature CLEAR and DISCONNECT. select c.custno,c.cname,c.dac,n.notes,n.hot_issues from bcimp.v4_cust c, bcimp.v4_cust_notes n where c.group='RSBC' and c.group=n.group and c.custno=n.custno order by c.cname fbh 0: 'CUSTNO' , type 1, 7, dsize 7, p0 s-2140108372 out: ftype 1, indp 0, bufl 29, rlen 29 fbh 1: 'CNAME' , type 1, 30, dsize 30, p0 s-2140108292 out: ftype 1, indp 0, bufl 121, rlen 121 fbh 2: 'DAC' NULLable, type 1, 5, dsize 5, p0 s-2140108212 out: ftype 1, indp 0, bufl 21, rlen 21 fbh 3: 'NOTES' NULLable, type -99, 0, dsize 524288, p0 s-2140108128 out: ftype 0, indp 0, bufl 0, rlen 0 fbh 4: 'HOT_ISSUES' NULLable, type -99, 0, dsize 524288, p0 s-2140108048 out: ftype 0, indp 0, bufl 0, rlen 0 <- prepare= ( DBI::st=HASH(0x802307f0) ) [1 items] at ./custlist.cgi line 384 via at ./custlist.cgi line 140 -> execute for DBD::DB2::st (DBI::st=HASH(0x802307f0)~0x80230760) <- execute= ( -1 ) [1 items] at ./custlist.cgi line 385 via at ./custlist.cgi line 140 -> fetchrow for DBD::DB2::st (DBI::st=HASH(0x802307f0)~0x80230760) dbih_setup_fbav alloc for 5 fields dbih_setup_fbav now 5 fields dbd_st_fetch 5 fields 0: rc=0 'DATA' 1: rc=0 'DATA DATA' 2: rc=0 '' 3: rc=0 'DATA DATA' 4: rc=0 '' <- fetchrow= ( 'DATA' 'DATA DATA' '' 'DATA DATA' '' ) [5 items] row1 at ./custlist.cgi line 386 via at ./custlist.cgi line 140 -> prepare for DBD::DB2::db (DBI::db=HASH(0x80230448)~0x80230370 'select t.tsm_name,c.type,t.ph_tl,t.email from bcimp.v4_tsm_cfg t, bcimp.v4_cust_tsm c where c.custno='DATA' and c.group='RSBC' and t.retain_id=c.retain_id and c.type in ('p','s') and c.group=t.group') New 'DBI::st' (for DBD::DB2::st, parent=DBI::db=HASH(0x80230370), id=undef) dbih_setup_handle(DBI::st=HASH(0x80706558)=>DBI::st=HASH(0x807064e0), DBD::DB2::st, 80706828, Null!) dbih_make_com(DBI::db=HASH(0x80230370), 80702dd0, DBD::DB2::st, 272, 0) thr#0 dbih_setup_attrib(DBI::st=HASH(0x807064e0), Err, DBI::db=HASH(0x80230370)) SCALAR(0x803fb240) (already defined) dbih_setup_attrib(DBI::st=HASH(0x807064e0), State, DBI::db=HASH(0x80230370)) SCALAR(0x803fb300) (already defined) dbih_setup_attrib(DBI::st=HASH(0x807064e0), Errstr, DBI::db=HASH(0x80230370)) SCALAR(0x803fb2a0) (already defined) dbih_setup_attrib(DBI::st=HASH(0x807064e0), TraceLevel, DBI::db=HASH(0x80230370)) 15 (already defined) dbih_setup_attrib(DBI::st=HASH(0x807064e0), FetchHashKeyName, DBI::db=HASH(0x80230370)) 'NAME' (already defined) dbih_setup_attrib(DBI::st=HASH(0x807064e0), HandleSetErr, DBI::db=HASH(0x80230370)) undef (not defined) dbih_setup_attrib(DBI::st=HASH(0x807064e0), HandleError, DBI::db=HASH(0x80230370)) undef (not defined) dbih_setup_attrib(DBI::st=HASH(0x807064e0), ReadOnly, DBI::db=HASH(0x80230370)) undef (not defined) dbih_setup_attrib(DBI::st=HASH(0x807064e0), Profile, DBI::db=HASH(0x80230370)) undef (not defined) dbd_st_prepare'd sql f65538 select t.tsm_name,c.type,t.ph_tl,t.email from bcimp.v4_tsm_cfg t, bcimp.v4_cust_tsm c where c.custno='DATA' and c.group='RSBC' and t.retain_id=c.retain_id and c.type in ('p','s') and c.group=t.group fbh 0: 'TSM_NAME' NULLable, type 1, 50, dsize 50, p0 s-2140104692 out: ftype 1, indp 0, bufl 201, rlen 201 fbh 1: 'TYPE' NULLable, type 1, 1, dsize 1, p0 s-2140104612 out: ftype 1, indp 0, bufl 5, rlen 5 fbh 2: 'PH_TL' NULLable, type 1, 20, dsize 20, p0 s-2140104532 out: ftype 1, indp 0, bufl 81, rlen 81 fbh 3: 'EMAIL' NULLable, type 1, 40, dsize 40, p0 s-2140104452 out: ftype 1, indp 0, bufl 161, rlen 161 <- prepare= ( DBI::st=HASH(0x80706558) ) [1 items] at ./custlist.cgi line 421 via at ./custlist.cgi line 140 -> execute for DBD::DB2::st (DBI::st=HASH(0x80706558)~0x807064e0) <- execute= ( -1 ) [1 items] at ./custlist.cgi line 422 via at ./custlist.cgi line 140 -> fetchrow for DBD::DB2::st (DBI::st=HASH(0x80706558)~0x807064e0) dbih_setup_fbav alloc for 4 fields dbih_setup_fbav now 4 fields dbd_st_fetch 4 fields 0: rc=0 'DATA' 1: rc=0 'p' 2: rc=0 'DATA DATA' 3: rc=0 'DATA DATA' <- fetchrow= ( 'DATA' 'p' 'DATA DATA' 'DATA DATA' ) [4 items] row1 at ./custlist.cgi line 423 via at ./custlist.cgi line 140 -> fetchrow for DBD::DB2::st (DBI::st=HASH(0x80706558)~0x807064e0) dbd_st_fetch 4 fields 0: rc=0 'DATA' 1: rc=0 's' 2: rc=0 'DATA DATA' 3: rc=0 'DATA DATA' <- fetchrow= ( 'DATA' 's' 'DATA DATA' 'DATA DATA' ) [4 items] row2 at ./custlist.cgi line 425 via at ./custlist.cgi line 140 -> fetchrow for DBD::DB2::st (DBI::st=HASH(0x80706558)~0x807064e0) !! info: '' '[IBM][CLI Driver][DB2/LINUXZ64] SQL0100W No row was found for FETCH, UPDATE or DELETE; or the result of a query is an empty table. SQLSTATE=02000 ' (err#0) <- fetchrow= ( ) [0 items] row2 at ./custlist.cgi line 425 via at ./custlist.cgi line 140 !! info: '' CLEARED by call to finish method -> finish for DBD::DB2::st (DBI::st=HASH(0x80706558)~0x807064e0) <- finish= ( 1 ) [1 items] at ./custlist.cgi line 427 via at ./custlist.cgi line 140 -> fetchrow for DBD::DB2::st (DBI::st=HASH(0x802307f0)~0x80230760) dbd_st_fetch 5 fields 0: rc=0 'DATA DATA' 1: rc=0 'DATA DATA' 2: rc=0 'DATA DATA' !! info: '' 'SQL_NO_DATA returned from Diagnostic Information. There might be no diagnostic records for this handle. Please see Infocentre for more details!!' (err#0) <- fetchrow= ( ) [0 items] row2 at ./custlist.cgi line 447 via at ./custlist.cgi line 140 !! info: '' CLEARED by call to finish method -> finish for DBD::DB2::st (DBI::st=HASH(0x802307f0)~0x80230760) <- finish= ( 1 ) [1 items] at ./custlist.cgi line 450 via at ./custlist.cgi line 140 -> disconnect for DBD::DB2::db (DBI::db=HASH(0x80230448)~0x80230370) <- disconnect= ( 1 ) [1 items] at ./custlist.cgi line 560 via at ./custlist.cgi line 143 ! -> DESTROY for DBD::DB2::st (DBI::st=HASH(0x807064e0)~INNER) ! <- DESTROY= ( undef ) [1 items] during global destruction ! -> DESTROY for DBD::DB2::st (DBI::st=HASH(0x80230760)~INNER) ! <- DESTROY= ( undef ) [1 items] during global destruction ! -> DESTROY for DBD::DB2::db (DBI::db=HASH(0x80230370)~INNER) ! <- DESTROY= ( undef ) [1 items] during global destruction

Message body is not shown because it is too large.

Explicitly turning OFF and ON autocommit (for transaction) in the perl script will solve the issue. Closing the defect. -- Thanks Praveen IBM OpenSource Application Development Team India Software Labs, Bangalore (India)
Marking the defect resolved. -- Thanks Praveen IBM OpenSource Application Development Team India Software Labs, Bangalore (India)