> No, it shouldn't -- but I can't see the crash message -- what does the > dialog box say?.
No dialog box at all... without trace set, I just get a "perl.exe has created an error", and with trace set, the service dies silently (it's a service created with PerlSvc)... The program worked well before I had put in the select from the $db2dbh the select from $msdbh. This is the structure of the program: Old Version: Select from DB2 Insert into MS remeber deleted Delete from DB2 remembered now I have: Select from DB2 Select from MS Compare $barcode, depending on result Update into MS + remember or Insert into MS + remember Delete from DB2 I remember having a similar problem, when I had the Delete from DB2 right after the Insert into MS. That's why my guess was, the concurrent handles have a problem. > If you can, send a small sample with create tables, etc, which > reproduces this. For example script1 would have create table > on the DB2 > side and insert data, script2 would have create tables on the > MSSQL side > and script three would be a small part of what you are trying to do in > the crashing script. The idea is to cut it down to the smallest > possible, reproducable issue (the easier it is for me to look at and > run, the faster I can get to it :) mh, dunno how I can get those scripts, I'm a DB dummy ;) I'll try to reduce the code below to the minimum... > > $db2dbh = DBI->connect("dbi:ODBC:DB2I21", "tefide", "*****", > > { RaiseError => 0, PrintError => 1, AutoCommit => 1} ) or do > > {print LOG "!!!!!!!!!!!!!!!!!!!!!!!!!!$now $DBI::errstr\n" ; > > $seconds=300 ; next MAINLOOP}; > > > > $msdbh = DBI->connect("dbi:ODBC:BTETRANSFER", "LOtest", > > "*****", { RaiseError => 0, PrintError => 1, AutoCommit => 1 > > } ) or do {print LOG "!!!!!!!!!!!!!!!!!!!!!!!!!!$now > > $DBI::errstr\n" ; $seconds=300 ; next MAINLOOP}; > > > > $db2sth = $db2dbh->prepare("SELECT * FROM db2bt0xd.bt02th8"); > > if ($db2sth->execute) { > > while ( @row = $db2sth->fetchrow_array ) { > > > > > ($alfdnr,$anr,$lsdat,$bestnr,$lnr,$kurzname,$oe,$notiz,$aname) = @row; > > $timestamp=time(); > > # Kürzen auf 20 Zeichen > > # Prüfung ob Barcode bereits in MSSQL > > $mssth = $msdbh->prepare("SELECT Barcode FROM BTEDATEN"); > > $mssth->execute; > > while (@barcodes=$msdbh->fetchrow_array) { > > ($barcode) = @barcodes; > > if ($barcode eq $alfdnr) { > > $dupe=1; > > } > > } > > if ($dupe==1) { > > $mssth = $msdbh->prepare("UPDATE > > BTEDATEN SET Firma='$kurzname', LSNR='$anr', LSDAT='$lsdat', > > ANABT='$anforderer', AKNR='$bestnr', BTENOTIZ='$keepnotiz' > > WHERE Barcode='$alfdnr'"); > > print LOG "Doppelter Barcode: $alfdnr wird > > updated!\n"; > > if ($mssth->execute) { > > push @todelete, $alfdnr; > > } > > } > > else { > > $mssth = $msdbh->prepare("INSERT INTO > > BTEDATEN > > (Barcode,Firma,LSNR,LSDAT,ANABT,AKNR,TKNR,VONABT,BESTELLNR,SON > > STIGES,TIMESTA > > MP,BTENOTIZ) VALUES ('$alfdnr', '$kurzname', '$anr', > > '$lsdat', '$anforderer', > > '$bestnr','','','','','$timestamp','$keepnotiz')") ; > > print LOG "Unique Barcode: $alfdnr wird > > inserted\n"; > > # geschriebene Daten merken zum Löschen > > if ($mssth->execute) { > > push @todelete,$alfdnr; > > } > > } > > } > > $c_todelete=@todelete; > > print LOG "###################### $c_todelete Entries > > to delete from > > BTE: @todelete\n"; > > # Daten aus DB2 löschen > > foreach $raus (@todelete) { > > $db2sth = $db2dbh->prepare("DELETE FROM > > db2bt0xd.bt02th8 WHERE A_LFDNR=$raus"); > > $db2sth->execute; > > } > > }