]> ruin.nu Git - ND.git/commitdiff
Don't print warnings and clean up better
authorMichael Andreen <harv@ruin.nu>
Sun, 20 Jul 2008 12:42:44 +0000 (14:42 +0200)
committerMichael Andreen <harv@ruin.nu>
Sun, 20 Jul 2008 12:42:44 +0000 (14:42 +0200)
DB.pm

diff --git a/DB.pm b/DB.pm
index 43979d852fcca08fb0f9320646a810f247477e93..53db830c0f30b2f38012dee396b48e40f54b4880 100644 (file)
--- 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;