perlCrazy has asked for the wisdom of the Perl Monks concerning the following question:

Error Description :
Issuing rollback() for database handle being DESTROY'd
without explicit disconnect()
if ($config->get("campaigntransfer_db", fail_soft => 1)) { <br> my($dbconn, $dbuser, $dbpass, $dbschema) = split(/\s+/, $config->get(" +campaigntransfer_db"));<br> my $dbh = DBI->connect("dbi:Pg:dbname=hermes","hermes","",{ RaiseError + => 1, PrintError => 0, AutoCommit => 0, ShowErrorStatement => 1 });< +br> my @bannedemails;<br> $qentry->logger->info("debug Ravish 1st line");<br> # Check specific emails first, then regex matches # Check locale-specific bans before global bans my $stmt = $dbh->prepare_cached("select regex, email, '[' <br>|| id | +| case locale when '*' then '*' else '' end || <br>case regex when 't +' then '+' else '' end || '] ' || reason as message from ".($dbschema + ? "$dbschema." : "")."bannedemails where locale <br>in (?, '*') orde +r by case regex when 't' then 1 else 0 end, case locale when '*' then + 1 else 0 end"); <br> $stmt->execute($qentry->campaign_locale);<br> my($is_regex, $pattern, $reason);<br> $stmt->bind_columns(\$is_regex, \$pattern, \$reason); <br> my @regexes; my %literal; while ($stmt->fetch) { <br> my $regex; if ($is_regex) { <br> push @regexes, [qr{$pattern}i, $reason]; <br> } else { $literal{lc($pattern)} = $reason; } } $dbh->disconnect; <br> $qentry->logger->info("debug Ravish 2nd line");<br> $qentry->logger->debug1("Fetched ".(scalar @regexes)." regexes and ".( +scalar keys %literal)." literal email <br>addresses to blacklist"); return (\@regexes, \%literal); <br> } return ([], {}); <br>

Environment details:
I am upgrading the perl version from 5.8.0 to 5.8.5.
there is perl module which does connect to posgres database
On 5.8.0 I am not getting any error while running the code
But same code if I run on 5.8.5 getting error

Issuing rollback() for database handle being DESTROY'd
without explicit disconnect()


Pls. advice if anything to do with DBD module or suggest
some solutions.

Replies are listed 'Best First'.
Re: DBD related problem
by monkey_boy (Priest) on Oct 20, 2005 at 11:01 UTC
    You have AutoCommit set to 0, and you never call $dbh->commit;
    So DBI explicitly calls: $dbh->rollback for you just before exit, thus generating your warning.



    This is not a Signature...