On Aug 24, 2011, at 7:51 AM, tiger peng wrote:
> I am subclassing DBI for authenticating purpose by overwriting connection.
>
> I try to turn off warning message "Issuing rollback() for database handle
> being DESTROY'd without explicit disconnect()" by explicitly issuing
> rollback, disconnect and set AutoCommit to 0 without success. Could you
> please provide any solution and/or suggestion? My environment is quite old
> (Perl/5.80; DBI/1.30; DBD::Oracle/1.12).
Well first of all, upgrade Perl and those modules, if at all possible. That DBI
is NINE YEARS OLD!
As for the warning, what I generally do is disconnect in an END block right
after I connect, like so:
my $dbh = DBI->connect('dbi:Oracle:...');
END { $dbh->disconnect if $dbh }
I also recommend against having AutoCommit set to 0, as that means you have a
transaction open all the time. You should just use transactions when you have
reason to use them, that is for database writes.
Best,
David