X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FResultSourceHandle.pm;h=169cb4a787508d9bc11398b4a2bb6556cb4d8ea4;hb=6c5aa1fbffdc9e5679d2f68780b11a9569ec1993;hp=05be07d14391578f9596c752de6f0e9c7a261618;hpb=a2bd379666d729133d65c85dc775627937084b18;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/ResultSourceHandle.pm b/lib/DBIx/Class/ResultSourceHandle.pm index 05be07d..169cb4a 100644 --- a/lib/DBIx/Class/ResultSourceHandle.pm +++ b/lib/DBIx/Class/ResultSourceHandle.pm @@ -5,7 +5,7 @@ use warnings; use base qw/DBIx::Class/; -use Try::Tiny; +use DBIx::Class::_Util 'dbic_internal_try'; use namespace::clean; use overload @@ -112,11 +112,16 @@ sub STORABLE_thaw { } elsif( my $rs = $from_class->result_source_instance ) { # in the off-chance we are using CDBI-compat and have leaked $schema already - if( my $s = try { $rs->schema } ) { + if( my $s = dbic_internal_try { $rs->schema } ) { $self->schema( $s ); } else { - $rs->source_name( $self->source_moniker ); + # FIXME do not use accessor here - will trigger the divergent meta logic + # Ideally this should be investigated and fixed properly, but the + # codepath is so obscure, and the trigger point (t/52leaks.t) so bizarre + # that... meh. + $rs->{source_name} = $self->source_moniker; + $rs->{_detached_thaw} = 1; $self->_detached_source( $rs ); }