From: Michael Andreen Date: Sun, 20 Jul 2008 12:42:44 +0000 (+0200) Subject: Don't print warnings and clean up better X-Git-Url: https://ruin.nu/git/?p=ND.git;a=commitdiff_plain;h=b2d8b311939cec8d428cdeee57bdb7c83d837d92 Don't print warnings and clean up better --- diff --git a/DB.pm b/DB.pm index 43979d8..53db830 100644 --- a/DB.pm +++ b/DB.pm @@ -14,7 +14,11 @@ sub DB { my $dbh = DBI->connect_cached("dbi:Pg:dbname=ndawn", "ndawn", "", {AutoCommit => 1, RaiseError => 1}); #Easy to also use /etc/postgresql/pg_services.conf #my $dbh = DBI->connect_cached("dbi:Pg:service=ndawn","", "", {AutoCommit => 1}); - $dbh->rollback if $dbh->{Executed} || !$dbh->{AutoCommit}; + { + no warnings; + local $dbh->{Warn} = 0; + $dbh->do('ABORT; RESET ALL; SET SESSION AUTHORIZATION DEFAULT; DEALLOCATE ALL'); + } return $dbh; }; 1;