On 8/22/06, Andreas Dembach <[EMAIL PROTECTED]> wrote:
Skipping the Catalyst part of things and just focusing on DBIx::Class: This should be a non-issue as long as you're using schema objects rather than schema classes, which is the preferred and recommended way to go about things.
Are you directly accessing the schema class? Are you using Catalyst::Model::DBIC::Schema? Can you paste/post your Schema and Model files, so we can see exactly how you're connecting things? I *think* C::M::DBIC::Schema handles this case correctly, but of course there could be a bug or thinko of some kind.
-- Brandon
Hello list,
we have the following situation:
- we are migrating mod_perl application to Catalyst under mod_perl2 and
use DBIC as persistence layer.
- the apache server hosts two (in fact even more) virtual hosts with the
same application but different configurations (e.g. one for test and one
for production).
- beneath other configuration items, like template-root we want the
different virtual hosts to use different database connections.
Problem:
As far as I can tell from the source code, DBIx::Class::Storage::DBI
caches the database handle in '_dbh' which results in always using the
first database handle that inititated a connection. So we end up having
the configured $dbh of whatever virtual host is called first within a
newly created Apache process.
Question:
Is this a design decision to support only one DB connection per process
or is this a little bug that could be fixed by caching the dbh with some
additional meta info (e.g. the connection parameters à la
DBI->connect_cached)?
Skipping the Catalyst part of things and just focusing on DBIx::Class: This should be a non-issue as long as you're using schema objects rather than schema classes, which is the preferred and recommended way to go about things.
Are you directly accessing the schema class? Are you using Catalyst::Model::DBIC::Schema? Can you paste/post your Schema and Model files, so we can see exactly how you're connecting things? I *think* C::M::DBIC::Schema handles this case correctly, but of course there could be a bug or thinko of some kind.
-- Brandon
_______________________________________________ List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class Wiki: http://dbix-class.shadowcatsystems.co.uk/ IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/ Searchable Archive: http://www.mail-archive.com/[email protected]/
