> -----Original Message-----
> From: Niral Trivedi [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 18, 2000 1:11 PM
> To: '[EMAIL PROTECTED]'
> Subject: Confusion on Apache::DBI
> 
> 
> All,
> 
> Sorry if this question sounds stupid.. but I am new to mod_perl and
> Apache::DBI.. I have successfully installed Apache Server 1.3.12 and
> mod_perl 1.24 and Apache::DBI 0.87 on Solaris 2.7.
> 
> And I have tested all successfully... But confusion arised when I
> created a startup.pl file and tried to initiate DB connection in
> startup.pl file using 'connect_on_init' from Apache::DBI
> 
> As I understood, if you have 'connect_on_init' in startup 
> file, you have
> preloaded DB handle when first request comes in. And you don't need to
> open new db connection... But if I check the error_log file, I still
> have entry saying something like following: 

Apache::DBI caches by connect-string, so make sure that your DBI->connect
call is identical to your Apache::DBI->connect_on_init call, including all
the extra parameters.

> 
> 10803 Apache::DBI             need ping: yes
> 10803 Apache::DBI             new connect to
> 'DatabaseNameUsernamePasswordAutoCommit=1PrintError=1'
> 10803 Apache::DBI             disconnect (overloaded) 
> 
> And I will get this for first 4-5 request but after that each 
> time I am
> getting 

are you sure that these 4-5 requests are for the same child? pay close
attention to the pid...

> 
> 10803 Apache::DBI             need ping: yes
> 10803 Apache::DBI             already connected to
> 'DatabaseNameUsernamePasswordAutoCommit=1PrintError=1'
> 10803 Apache::DBI             disconnect (overloaded) 
> 
> Why is that??? Shouldn't I supposed to get 'already connected to'
> statement right from the first request???? 

yes, so long as you called connect_on_init properly.  but don't forget, when
a child is born, you'll get the 'new connect' output.  connect doesn't
happen at startup, per-se.  that is, the parent process doesn't cache the
handle, the child does...

> 
> And how many open connection can I have at the same time?? As per my
> understood, for Apache::DBI connection pooling is based per server
> process. So, I guess as many server process you have, you can have db
> connection handle open at the same time.. AM I RIGHT HERE?

yes, you will have as many database handles as you have httpd children...

HTH

--Geoff

> 
> Please clear my doubts on this...
> 
> And thanks for your help ...
> 
> Niral
> 

Reply via email to