[Dbix-class] weird result_source_instance problem

Tobias Kremer list at funkreich.de
Thu May 24 13:55:19 GMT 2007


I have manually set up a ResultSource using result_source_instance in one of
my DBIC Schema classes called MyApp::Schema::User:

  my $source = __PACKAGE__->result_source_instance();
  my $my_source = $source->new( $source );
  $my_source->source_name( 'MyResultSource' );
  my $sql = "...complex-sql-with-various-bind-parameters...";
  $my_source->name( \"(${sql})" );
  MyApp::Schema->register_source( 'MyResultSource' => $my_source );

Everything worked great until I recently tried to add another class to my
schema. Even after introducing the result_source_instance magic shown above
I was able to successfully add new classes to my schema. But now it seems
that I can't have more than 14 classes in my schema. I know this sounds
stupid but as soon as I delete an existing class and afterwards add a new
one it works fine - as long as I stay below 14 classes in total.

The problem is that even calls on MyApp::Schema::User ResultSets to
standard relationships defined via has_many trigger the execution of the
manually added ResultSource above - which of course fails with a
"called with x bind variables when y are needed" error message.

Any ideas what could be causing this strange behaviour?

Thanks a lot!

--Tobias



More information about the Dbix-class mailing list