views:

28

answers:

1

This question is related to our web-based application, which uses perl, apache, Apache::DBI and a database (MySQL, SQLite, or anything).

We know that Apache::DBI is used to create persistent db connections. These connections live in memory from the time the Apache web server starts to the time it shuts down.

My Question is: Is it possible to create persistent db connections at any arbitrary time between the start and end of Apache process? We don't want to have persistent connections throughout the life of the Apache web server process.

We need to create persistent connections any time after the Apache web server is started. And we need to end persistent connections any time before the Apache web server is shut down.

A: 
benzebuth
Hi Benzebuth, I think your solution will not create a persistent connection that can be available for few requests and responses between server and client. I think the solution should involve Apache::DBI.
Vijey
well... i think it does, if you use mod_perl and load the module at apache startup.but i might be wrong
benzebuth
i'll run some test on my side. Tell you later how it works
benzebuth
after investigating a bit, i found out that in the "solution" i gave, the db connection lives not throught the whole srever life, but through threads life. ie : some users may share some apache threads, thus sharing db connection. but where the thread is down (off), so is the db connection.
benzebuth