Persistent connections are done by either calling an extension's
*_pconnect function, like db2_pconnect() instead of db2_connect(). Or,
if you are using PDO, by setting the ATTR_PERSISTENT (I think that's
correct, off the top of my head) setting to true.
You are correct. Apache keepalive is different. It maintains an open
connection to the browser after a request has been filled so that for
the next request, the TCP handshake does not need to occur. However,
the lifetime of that keepalive should be long enough only to service the
related HTTP requests for that individual page (CSS, JS, images, etc.)
to keep from DoS-ing your system. Here is some lame ASCII art to
illustrate it.
Browser -> keepalive -> Apache -> PHP -> pconnect -> DB2
Kevin
-----Original Message-----
From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx]
On Behalf Of Nathan Andelin
Sent: Thursday, June 11, 2009 10:13 AM
To: Web Enabling the AS400 / iSeries
Subject: Re: [WEB400] Reusing User ID and Password with Zend
i5_Program_Call
From: Kevin Schroeder
Persistent connections are different from pooling in that each
individual pre-forked Apache process will maintain an open
connection to the database ...
Are persistent connections automatic? The default behavior? Or, is
there a configuration directive? Or a DB connection property? Or
something else?
The term "persistent connections" often refers to the Apache keep-alive
setting, but I gather that in this case, Apache keep-alive has nothing
to do with it.
Nathan.
As an Amazon Associate we earn from qualifying purchases.