From b2d8b311939cec8d428cdeee57bdb7c83d837d92 Mon Sep 17 00:00:00 2001 From: Michael Andreen Date: Sun, 20 Jul 2008 14:42:44 +0200 Subject: [PATCH] Don't print warnings and clean up better --- DB.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; -- 2.39.2