Index: /branches/release-38/lib/MT/ObjectDriver/Driver/DBD/mysql.pm
===================================================================
--- /branches/release-38/lib/MT/ObjectDriver/Driver/DBD/mysql.pm (revision 1769)
+++ /branches/release-38/lib/MT/ObjectDriver/Driver/DBD/mysql.pm (revision 2367)
@@ -37,18 +37,20 @@
 }
 
-sub configure {
+sub init_dbh {
     my $dbd = shift;
-    my ($driver) = @_;
-    $dbd->_set_names($driver);
-    $dbd;
+    my ($dbh) = @_;
+    $dbd->SUPER::init_dbh(@_);
+    $dbd->_set_names($dbh);
 }
 
 sub _set_names {
     my $dbd = shift;
-    my ($driver) = @_;
-    my $dbh = $driver->rw_handle;
+    my ($dbh) = @_;
+    return 1 if exists $dbh->{private_set_names};
 
+warn "got here";
     my $cfg = MT->config;
     my $set_names = $cfg->SQLSetNames;
+    $dbh->{private_set_names} = 1;
     return 1 if (defined $set_names) && !$set_names;
 
@@ -56,6 +58,6 @@
         local $@;
         my $sth = $dbh->prepare('show variables like "character_set_database"')
-            or return $driver->error($dbh->errstr);
-        $sth->execute or return $driver->error($sth->errstr);
+            or die "error collecting variables from mysql: " . $dbh->errstr;
+        $sth->execute or die "error collecting variables from mysql: " . $sth->errstr;
         my $result = $sth->fetchall_hashref('Variable_name');
         my $charset_db = $result->{character_set_database}{Value};
Index: /branches/release-38/lib/MT/ObjectDriver/Driver/DBD/Pg.pm
===================================================================
--- /branches/release-38/lib/MT/ObjectDriver/Driver/DBD/Pg.pm (revision 1769)
+++ /branches/release-38/lib/MT/ObjectDriver/Driver/DBD/Pg.pm (revision 2367)
@@ -52,7 +52,5 @@
     my $dbd = shift;
     my ($driver) = @_;
-    $dbd->_set_names($driver);
     $driver->pk_generator(\&pk_generator); 
-
     return $dbd;
 }
@@ -86,13 +84,19 @@
 }
 
+sub init_dbh {
+    my $dbd = shift;
+    my ($dbh) = @_;
+    $dbd->SUPER::init_dbh(@_);
+    $dbd->_set_names($dbh);
+}
+
 sub _set_names {
     my $dbd = shift;
-    my ($driver) = @_;
-    my $dbh = $driver->r_handle;
-    return 1 if exists $driver->{set_names};
+    my ($dbh) = @_;
+    return 1 if exists $dbh->{private_set_names};
 
     my $cfg = MT->config;
     my $set_names = $cfg->SQLSetNames;
-    $driver->{set_names} = 1;
+    $dbh->{private_set_names} = 1;
     return 1 if (defined $set_names) && !$set_names;
 
