Subject: | DBIx::Class::ResultSet object not usable after schema goes out of scope |
The following testcase fails. It is based on the CD, Artist example in
the DBIx-Class documentation. I know that this doesn't look very
reasonable, but I'm using a similar setup in conjunction with connection
pooling.
------------------------------------
use DB::Main;
sub getRecordset {
my $sClass = shift;
my $oSchema = DB::Main->connect('DBI:mysql:database=dbixtest','', '', {});
return $oSchema->resultset($sClass);
}
my $record = getRecordset('Artist');
while (my $element = $record->next()) {
print $element->name;
}
------------------------------------
It seems that the result_source->schema attribute is empty after it
leaves the 'getRecordset' function in the example above.
The errormessage runs as follows:
Can't call method "storage" on an undefined value at
C:\Lang\Perl\5.8.8\site\lib/DBIx/Class/ResultSource.pm line 411.
I'm running DBIx-Class 0.07 with Perl 5.8.8 (Activestate) on Win32.