move sorting call outside of transaction call
Tom Bloor [Fri, 22 May 2015 14:39:40 +0000 (14:39 +0000)]
lib/DBIx/Class/Fixtures.pm

index 9f9074a..ca67622 100644 (file)
@@ -1353,9 +1353,9 @@ sub populate {
     $fixup_visitor = new Data::Visitor::Callback(%callbacks);
   }
 
+  my @sorted_source_names = $self->_get_sorted_sources( $schema );
   $schema->storage->txn_do(sub {
     $schema->storage->with_deferred_fk_checks(sub {
-      my @sorted_source_names = $self->_get_sorted_sources( $schema );
       foreach my $source (@sorted_source_names) {
         $self->msg("- adding " . $source);
         my $rs = $schema->resultset($source);