Hi

 

When I call create on a result set like the same in the catalyst
documentation  like 

 

               my $book = $c->model('DB::Book')->create({title  => $title,
rating => $rating });

I get the following error 

 

DBIx::Class::ResultSet::create(): Unable to perform storage-dependent
operations with a detached result source (source '_unnamed_' is not
associated with a schema). at
/home/gordon/catalyst/test/script/../lib/test/Controller/Books.pm line 56

 

I am using the most up to date version of catalyst, DBIx::Class.  I am also
using it with a MySQL backend.

 

Is there a setting I need to set so this error messages goes away and insert
records into the database?  Has anyone had similar issues

 

 

I raised this issue with the DBIx::Class mailing list and they said:

 

The fix is to insert this line before you serialize the object:

 

# to let DBIC automatically pick up the correct schema in the child #
process after Storable freezed/thawed the result objects local 

 

$DBIx::Class::ResultSourceHandle::thaw_schema = $rs->result_source->schema;

 

I am unsure where to put this in my application.  Has anyone have ideas how
to resolve this 

 

Regards 

 

Gordon 

 

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[email protected]

Reply via email to