From 8014b90805aa85adf1d1155cbb07fa77e5c58f62 Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Tue, 22 Jan 2008 22:46:34 +0000 Subject: Add a Wallet::Database class that now holds the database connection code previously in Wallet::Server. Remove all the attribute setting on database handles in the other classes since Wallet::Database handles that initialization. --- perl/Wallet/Object/Base.pm | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'perl/Wallet/Object') diff --git a/perl/Wallet/Object/Base.pm b/perl/Wallet/Object/Base.pm index e09c477..e712fd7 100644 --- a/perl/Wallet/Object/Base.pm +++ b/perl/Wallet/Object/Base.pm @@ -2,7 +2,7 @@ # $Id$ # # Written by Russ Allbery -# Copyright 2007 Board of Trustees, Leland Stanford Jr. University +# Copyright 2007, 2008 Board of Trustees, Leland Stanford Jr. University # # See LICENSE for licensing terms. @@ -23,7 +23,7 @@ use Wallet::ACL; # This version should be increased on any code change to this module. Always # use two digits for the minor version with a leading zero if necessary so # that it will sort properly. -$VERSION = '0.03'; +$VERSION = '0.04'; ############################################################################## # Constructors @@ -36,9 +36,6 @@ $VERSION = '0.03'; # probably be usable as-is by most object types. sub new { my ($class, $type, $name, $dbh) = @_; - $dbh->{RaiseError} = 1; - $dbh->{PrintError} = 0; - $dbh->{AutoCommit} = 0; my $sql = 'select ob_name from objects where ob_type = ? and ob_name = ?'; my $data = $dbh->selectrow_array ($sql, undef, $type, $name); $dbh->commit; @@ -58,9 +55,6 @@ sub new { # in the object. Subclasses may need to override this to do additional setup. sub create { my ($class, $type, $name, $dbh, $user, $host, $time) = @_; - $dbh->{RaiseError} = 1; - $dbh->{PrintError} = 0; - $dbh->{AutoCommit} = 0; $time ||= time; die "invalid object type\n" unless $type; die "invalid object name\n" unless $name; -- cgit v1.2.3