X-Git-Url: https://ruin.nu/git/?p=ND.git;a=blobdiff_plain;f=DB.pm;fp=DB.pm;h=53db830c0f30b2f38012dee396b48e40f54b4880;hp=43979d852fcca08fb0f9320646a810f247477e93;hb=b2d8b311939cec8d428cdeee57bdb7c83d837d92;hpb=30f707022d89930d31a3d6c83a788f182f65bbaf 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;