Hi!

 

Where does $agent come from? I only see $date (which should me declared with my 
$date btw).

Just for information, a resultset doesn’t contain any data, the sql is only 
generated and executed if you access the rs by array or iterator (or ->first 
like in your case).

So because the rs contains the db connection you can’t case it, only the result 
of it.

 

-Alex

 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 08, 2008 10:46 AM
To: [email protected]
Subject: [Dbix-class] Resultset with memcached

 

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 <http://pr.mail.yahoo.co.jp/toolbar/>  + Joy + Powerful = Yahoo! Bookmarks 
x Toolbar

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
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