[EMAIL PROTECTED] pressed the little lettered thingies in this order...

> hello,
> 
> I've this silly question:
> how can I pass a db persistent connection from a script to another? (it
> seems there's no way: but what's the use then of them?)
> 
> eg, I tryed this 2 scripts (with Oracle 8.1.6)
> 
> 
> <?php
> set_time_limit(0);
> $conn = ociplogon('user','pass','testdb');
> echo "Server Version: " . OCIServerVersion($conn);
> echo "<br><br> $conn";
> ?>
> 
> <?php
> echo "<br><br> $conn";
> OCILogOff($conn);
> ?>
> 
> this works if both are on the same page, but I see no way to pass $conn
> (with the associated info) to another one;
> 
> I've read on  http://marc.theaimsgroup.com/?l=php-db&m=97024385511984&w=2
> __________________________________ > I'd like to know if it is possible to
> create a session variable for a > database to get a persistent database
> connection. I've got > lots of updates If you think passing persistent
> connection between pages as other vars, answer is no.
> __________________________________
> 
> 
> there's really no way to do this?
> 
> 

The persistence of the DB connection follows the child process that 
serves your individual web page request.  The first time a child process 
requests a persistent DB connection, it will maintain that connection 
until the child process dies.  The problem is that when you are on a web 
site, when you request a page, the page is served and you disconnect 
from the child process.  The next request to the same site will use one 
of the other open child processes - not necessarily (and probably not 
usually) the same one.  The default configuration of Apache is to keep 
10 spare child processes running at all times.  On busy and semi-busy 
servers, child processes are created and destroyed regularly.  Once the 
child process is destroyed, the database connection is destroyed with it.

The bright side is that the connections are actually persistent, which 
means that you will in fact benefit.  The down side is that you are not 
going to always get the same persistent connection for each request. 
Doing so would probably not be possible over a stateless connection 
(as HTTP connections are).

http://www.php.net/manual/en/features.persistent-connections.php
Expalins this in pretty good detail.

have fun...

Christopher Ostmo
a.k.a. [EMAIL PROTECTED]
AppIdeas.com
Meeting cutting edge dynamic
web site needs

For a good time,
http://www.AppIdeas.com/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to