PoliceCoP has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

I'm using a catalyst model called 'DB' created by DBIx::Class. I want to use session::store::dbi, and am having difficulty with the configuration. Currently I receive an error:

session::Store::DBI: No session configuration found, please configure dbi_dbh

In my catalyst application.conf I have added the following fields:

<Session> expires 1200 dbi_dbh DB dbi_table session dbi_id_field id dbi_data_field session_data dbi_expires_field expires </Session>

and in Model::DB.pm I have the dbh:

__PACKAGE__->config( schema_class => 'Bookie::Schema', connect_info => { dsn => 'dbi:SQLite:sportsbook.db', user => '', password => '', on_connect_do => q{PRAGMA foreign_keys = ON}, } );

The model is working fine when I use session::Store::FastMmap, so I think that as per the error, I am not setting the correct dbi_dsn in the .conf file. I have tried every combination I can think of, using the package names of the result class, the schema, and simply the model name, but I keep receiving the same error.

I've searched this website and online for a solution, but can't find anything. So I would really appreciate some help from you guys!

Many thanks in advance,

Police

Replies are listed 'Best First'.
Re: Configuring Catalyst Session data for sessions::store::dbi
by Anonymous Monk on Jan 07, 2012 at 22:30 UTC
      UPDATED:

      I got it working, this is the complete .conf entry:

      <Plugin::Session> expires 1200 dbi_dbh DB dbi_table session dbi_id_field id dbi_data_field session_data dbi_expires_field expires </Plugin::Session>