_execute throws execptions as opposed to returning undef, so check errors that way
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Schema.pm
index 2913a2f..b1fa17f 100644 (file)
@@ -97,13 +97,17 @@ sub register_source {
 
   %$source = %{ $source->new( { %$source, source_name => $moniker }) };
 
-  $self->source_registrations->{$moniker} = $source;
+  my %reg = %{$self->source_registrations};
+  $reg{$moniker} = $source;
+  $self->source_registrations(\%reg);
 
   $source->schema($self);
 
   weaken($source->{schema}) if ref($self);
   if ($source->result_class) {
-    $self->class_mappings->{$source->result_class} = $moniker;
+    my %map = %{$self->class_mappings};
+    $map{$source->result_class} = $moniker;
+    $self->class_mappings(\%map);
   }
 }
 
@@ -499,7 +503,8 @@ more information.
   sub compose_connection {
     my ($self, $target, @info) = @_;
 
-    warn "compose_connection deprecated as of 0.08000" unless $warn++;
+    warn "compose_connection deprecated as of 0.08000"
+      unless ($INC{"DBIx/Class/CDBICompat.pm"} || $warn++);
 
     my $base = 'DBIx::Class::ResultSetProxy';
     eval "require ${base};";