On 12/21/2010 10:06 AM, Bill Moseley wrote:
> The advent article shows the configuration at the end:
>
> <Model::MyAppDB>
>
>     schema_class MyApp::Schema
>     <connect_info>
>
>         (your connect_info)
>
>         cursor_class DBIx::Class::Cursor::Cached
>
>         traits Caching
>
>     </connect_info>
>
> </Model::MyAppDB>

But (see line 25 of
http://cpansearch.perl.org/src/MSTROUT/DBIx-Class-Cursor-Cached-1.0.1/lib/DBIx/Class/Cursor/Cached.pm)
...
Where is "$attrs->{cache_object}" set?  What is setting it?  It isn't
set in the config you quote above.  Based on
http://search.cpan.org/~rkitover/Catalyst-Model-DBIC-Schema-0.48/lib/Catalyst/Model/DBIC/Schema.pm#ATTRIBUTES
-- wouldn't the config above need an extra line, something like:

> <Model::MyAppDB>
>
>     schema_class MyApp::Schema
>     <connect_info>
>
>         (your connect_info)
>
>         cursor_class DBIx::Class::Cursor::Cached
>
>         traits Caching
>
cache_object ...something indicating memcached here...
>
>     </connect_info>
>
> </Model::MyAppDB>

What is telling DBIx::Class::Cursor::Cached where to get
$attrs->{cache_object}, and where is $attrs->{cache_object} instantiated
as a new Cache::Memcached object?  The article seems to infer that you
just get this for free by setting up Catalyst::Plugin::Cache to use
memcached, but there's nothing in the source of
DBIx::Class::Cursor::Cached where it explicitly *pulls* in the cache
object from catalyst or a catalyst plugin.  Instead, it expects to be
receiving a cache object.  Forgive me, I just want to know:

- What is passing $attrs->{cache_object} to
DBIx::Class::Cursor::Cached::new() ?
- Where/when is the cache object created to which $attrs->{cache_object}
is a reference?
- How do I really know if it's a memcached backend?

-- 
Tommy
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to