Re: persistent database connections?
Ottavio Caruso schrieb:
> Volker, you opened a few threads on at least two ng's, that's
> crossposting. I am not a purist, but some may not like it. I used to do
> this and now I've learnt the lesson!
Thanks for the hint!
>
> Volker Hetzer wrote:
>> I want a database connection through http, clients will
>> probably use XML-RPC in their communication with apache.
>> The job of apache is to provide platform independence and
>> SSL.
>> But for the application to work I need persistent connections
>> to the database, so that if three clients open sessions with
>> the apache (i.e, there are three different values), I
>> want three database connections to be created, with each
>> one assigned to one session (based on the value).
>> This database connection should stay until the client has
>> logged off or the session has timed out.
>
> Http, as long as I know, does not offer persistent connections. Don't
> be fooled by some http1.1 features, such as keep-alive, they have
> nothing to do with a persistent connection. You can use session,
> and other tricks, but you have to use a scripting language
> (php, for instance) to do the job.
> If you want true persistent connection, don't use http.
Ok, I'll try to be more explicit:
I do not care whether the http connection (i.e. the connection
between client and apache) is persistent.
I'd like the connection between apache and the database to be
persistent and not to be reused by another session (i.e. session
value) open in the apache server.
Here's an example:
Client 1 logs on to apache and transmits the database login
"x" and password "y". Client gets a session with the
value "1".
The server (or a php script, whatever) opens a database
connection with those credentials and somehow associates it
with the value of "1". After apache has responded to
the client, the socket connection between client and apache
can become severed, as is usual with http.
But the database connection between apache and the database
persists and database user "x" does not get logged out of
the database.
Client 2 does the same, gets value 2 and another database
session, possibly with the same database credentials. Or not.
Now, client 1 sends the next request to apache, together with
the value of "1". My hope is that apache, or the
scripts of the application can now retrieve the correct
database connection.
Is that hope realistic? :-)
Lots of Greetings and thanks for your patience!
Volker
--
For email replies, please substitute the obvious.
|