> -----Original Message-----
> From: Niral Trivedi [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 18, 2000 3:15 PM
> To: Geoffrey Young
> Cc: '[EMAIL PROTECTED]'
> Subject: Re: Confusion on Apache::DBI
> 
> 
> Thanks Geoff,
> 
> You were right... I was using "DBI:mysql:DBNAME::localhost" as connect
> string in startup file whereas "DBI:mysql:DBNAME" in my mod_perl
> script.. I have changed that and it worked...
> 
> Now, another question.. As we agreed, we can have as many db handle
> available as server processes are running..
> 
> Now, can we set number of  db connection per server process 
> in script or
> in startup script or any other way???
> 
> Because what I see is in this way... Let's say a child process can
> handle 10 request and then dies.. now it has one db connection
> available.. 

I believe that once the child dies, $dbh goes out of scope and DBI cleans up
the connection.  I could be wrong, though...

> and it is processing one request which uses available db
> handle.. now what happen if another request comes in and ask 
> for same db
> handle??? 

well, another request won't come in and ask for the _same_ handle that died
with the other child - that's the nature of Apache::DBI, one handle per
child.  It's not a pool of shared connections, really...  Apache will either
serve the new request to an existing child (which would get a cached
connection) or initialize a new child (which would subsequently open a new
connection and cache it)...

> does that request has to wait for that or what??? 
> If yes, then
> is there any way we can set number of connection per process?? I mean
> each child process can have 5 db connection open at the same 
> time.. and
> it can grow upto 10.. So, if all 5 db handle are in use, and if 6th
> request comes in then process will open another connetion and 
> it can do
> like this upto max of 10 connection..
> 
> Is it possible??? has anybody done this kind of things before????

folks have talked about this type of stuff on the dbi-users list - it comes
up every so often...

I don't know that anyone has implemented a solution, though you might try
looking at DBI::ProxyServer - I think it does something like this (though I
haven't looked at it myself)

--Geoff

> 
> Thanks again for your help..
> 
> Niral
> 
> Geoffrey Young wrote:
> 
> >>
> >>
> 

Reply via email to