in reply to Re^4: SQLite with mod_perl
in thread SQLite with mod_perl
Do not cache your database handles, rather let Apache::DBI take care of it, use Apache::DBI in your mod_perl startup script (or use PerlModule Apache::DBI in your httpd.conf) then whenever you need to open a database connection, do it as would normally my $dbh = DBI->connect(...). If you need connections per user add private_username => $username to your connection attributes, like so:
This would ensure that each user would get a per-process database handle. Note that you can't share database handles across processes unless you use something single process like FastCGI.my $dbh = DBI->connect("dbi:SQLite:dbname=$dbfile", "", "", { private_ +username => $username });
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: SQLite with mod_perl
by punkish (Priest) on Oct 09, 2010 at 16:43 UTC |
In Section
Seekers of Perl Wisdom