[Dbix-class] Resultset with memcached

sindharta_tanuwijaya at yahoo.co.jp sindharta_tanuwijaya at yahoo.co.jp
Tue Jan 8 09:45:35 GMT 2008


Hi,

I am doing some experiments with memcached, hoping to make my web server faster, however I am wondering if we can use memcached together with DBIx::Class::Resultset ?

My code is like this:
..
..
    unless ( $data = $c->cache->get($cache_key) ) 
    {
      $date =
        $c->master->resultset('table_name')->search( 
          \%search_condition,
        ) ->first;
      $c->cache->set( $cache_key, $agent );
    }
..
..

When it bypasses the connection to the database and gets the value from the cache, this error message appears:

Couldn't render template "undef error - Can't call method "source" on an undefined value at /usr/lib/perl5/site_perl/5.8/DBIx/Class/ResultSourceHandle.pm line 64.

I am assuming it has something to do with the database connection variables and stuff, but I am not really sure. Has anyone done any similar experiment ?

Sindharta


 

 
---------------------------------
Easy + Joy + Powerful = Yahoo! Bookmarks x Toolbar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20080108/13c7d411/attachment.htm


More information about the DBIx-Class mailing list