http://www.perlmonks.org?node_id=710026


in reply to problems with class::dbi::sweet

Hi xido,

I also use Class::DBI::Sweet, CGI::Session, and a cache (Cache::Memcached in my case). I can assure you that your problem isn't with those modules. The most likely culprit is your session driver, which looks "non-standard".

I have two suggestions for you:

  1. try using CGI::Session with the default CGI::Session::Driver::DBI. Pass in MultiDesk::DB->get_handle as the handle
  2. or try turning off the cache on the class you use in the session driver, with $class->cache(undef). (you didn't show us which class that is, but it's accessed with $class->{ddb} in your get_session_from_user function)

If that doesn't help, try obtaining a full stack trace for that error, and see if that narrows it down. It'd be useful to know where the error gets triggered, and the parameters and objects involved.

Caching sessions isn't useful, in my experience, because it gets flushed to the database on every request anyway. So you don't really reduce load on the database.