>-----Message d'origine----- >De : [email protected] [mailto:sqlite-users- >[email protected]] De la part de Clark Christensen >Envoyé : lundi, 11. octobre 2010 17:26 >À : General Discussion of SQLite Database >Objet : Re: [sqlite] using SQLite with mod_perl > >>So, I want all the perl modules to be loaded when Apache2 starts, and >>then a $dbh created for each user when the user comes to the web site, >>but not recreated for the same user on every reload. I am assuming >>that would be the correct way to work speedily. > >I had the same problem, and it's a huge pain, even when you have root >privilege. > >I never did completely solve it. I had some success with explicit >$dbh->disconnect calls before the script exits, but I could never prove >why it >worked.
Creating a persistent dbh for each user doesn't make sense to me, because if the first request from user U1 is served by Apache process P4, there is no garantee that the next request will again go to process P4; if it goes to process P2, then that process will need its own connection. So the common practice is one persistent database connection for each Apache process, not for each user; if you need user_specific stuff, you pass that information through the shared connection. Furthermore, SQLite is just a file, it has no notion of users, so one connection per user makes even less sense. Ultimately, I abandoned mod_perl. Having to restart Apache >every time I update code in a module was a big obstacle. > Updated scripts are reloaded automatically. Updated modules are not reloaded by default, but if you want that behaviour you can activate http://search.cpan.org/~PHRED/Apache-Reload/ _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

