[Catalyst] Problem creating accessors once per server instance

Emmanuel Quevillon tuco at pasteur.fr
Wed Mar 11 15:04:42 GMT 2009


Hi list,

I am trying to create accessors to load static data once per server
instance as described at :

http://search.cpan.org/~hkclark/Catalyst-Manual-5.7017/lib/Catalyst/Manual/Cookbook.pod#Create_accessors_to_preload_static_data_once_per_server_instance

Following this tuts, I modified my Schema class as follow in MyApp/lib

package GenoList;

use strict;
use warnings;

use base 'DBIx::Class::Schema';

__PACKAGE__->load_classes;

__PACKAGE__->register_class('Organism',
                            'GenoList::Organism');
__PACKAGE__->mk_group_accessors('simple' => 'org_infos');

sub connection {

    my($self, @rest) = @_;
    $self->next::method(@rest);

    my $rs = $self->resultset('Organism')
      ->search(undef, { 'columns' => [qw/id name shortname fullname
strain/]});

    $self->org_infos({
        id     => $rs->id(),
        name   => $rs->fullname(),
        shname => $rs->shortname(),
        strain => $rs->strain || undef,
        #dbname => $rs->dbname,
    });

}

The first problem I have, sorry not to understand all the terms, is
to distinguish what is a RESULTSOURCEMONIKER.

While I start the catalyst server, I get the following error:
Couldn't instantiate component
"BiblioList::Model::GenoList::bovisR1db", "Can't locate object
method "id" via package "DBIx::Class::ResultSet" at
/home/tuco/src/perl/projects/Catalyst/BiblioList/bibliolist-0.06_02/script/../lib/GenoList.pm
line 23." at script/bibliolist_server.pl line 55

Can someone tell me what I am doing wrong?

Thanks for any help

Regards

Emmanuel


-- 
-------------------------
Emmanuel Quevillon
Biological Software and Databases Group
Institut Pasteur
+33 1 44 38 95 98
tuco at_ pasteur dot fr
-------------------------



More information about the Catalyst mailing list