[Dbix-class] Persistent connections with CGI::Application::Plugin::DBIx::Class

Jeffrey Fuller jfuller at mvpbanking.com
Tue Nov 9 15:33:55 GMT 2010


>
> I have two questions about using CGI::Application::Plugin::DBIx::Class for
> CRUD operations in a CGI::Application base app.
>
> 1. If I have setup the connection with $self->dbic_config({schema =3D>
> MyApp::Schema->connect(@connection_data)}) will $app->schema give me the
> full DBIx::Class schema instance, or will I get a restricted instance on
> which I can only call methods defined in the CAP::DBIx::Class documentation?
>
> 2. I am running my CGI::Application subclass under mod_perl. In this case
> with the connection be persistent? Or should I use Apache::DBI to ensure
> that it is.

If I recall correctly CAP::DBIC just associates the schema to the CA 
instance, along with some commonly used functions. So you should have 
access to everything.

I would not use Apache::DBI, because DBIC already manages its own 
connections, and they probably don't mix well. I believe DBIC makes a 
connection per-process, and keeps it persistent reconnecting only if the 
connection died, etc...



More information about the DBIx-Class mailing list