PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > alt.apache.configuration > persistent database connections?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
alt.apache.configuration Apache web server configuration issues.

persistent database connections?

Réponse
 
LinkBack Outils de la discussion
Vieux 06/10/2006, 10h49   #1 (permalink)
Volker Hetzer
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut persistent database connections?

Hi!
I'm totally new to web programming but - well, here's the situation:
We are buying some complex bit of software which is still very much in development.
So far it looks as if those guys really intend to do their own application server
between a database (oracle) and a number of clients.

Now, those clients all open sessions to the database (that is, the appserver does)
and execute requests which the appserver translates into database dependent sql.

We can give a bit of input to those people and I'd very much like to suggest that
they use apache as the application server because it saves us administration
costs, them development costs and both of us a lot of frust with their homegrown
"version 1" appserver.

But I do not know enough to make such a suggestion in good faith, and that's why
there is this posting.

So, is the above scenario (paragraphs one and two) possible at all with apache?
How far can one fit in apache into the middle of a three tier architecture
where html or web browsers don't come into the picture at all? Can client
connect to apache /only/ using http or are other ways like rpc possible too?
What about XML-RPC?

How are the database connections mapped to client sessions with login and
logout and transaction commits/rollbacks and timeouts?

How is apaches oracle support? In particular, does automatic failover to
a standby database work? (oracle speak: transparent failover)

Lots of Greetings!
Volker
--
For email replies, please substitute the obvious.
  Réponse avec citation
Vieux 06/10/2006, 15h22   #2 (permalink)
Ottavio Caruso
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: persistent database connections?

Volker Hetzer wrote:

> How far can one fit in apache into the middle of a three tier architecture
> where html or web browsers don't come into the picture at all?


Apache is an application that sits on top of http (Apache is also
called httpd). If you want a database connection but not http, you need
a different client/server solution.

If you decide that you need Apache to speak to Oracle, some references:
http://httpd.apache.org/docs/2.2/mod/mod_dbd.html
http://httpd.apache.org/related_projects.html#oracle

Ottavio

  Réponse avec citation
Vieux 09/10/2006, 14h48   #3 (permalink)
Volker Hetzer
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: persistent database connections?

Ottavio Caruso schrieb:
> Volker Hetzer wrote:
>
>> How far can one fit in apache into the middle of a three tier architecture
>> where html or web browsers don't come into the picture at all?

>
> Apache is an application that sits on top of http (Apache is also
> called httpd).

Yes, I do understand that.

> If you want a database connection but not http, you need
> a different client/server solution.

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.

So far, the only options I have seen apache offering are
- one connection per request,
- a pool of connections that get reused in a random manner.

Is there a third option like
- one connection per client session as identified by a
session ?

Lots of Greetings!
Volker
--
For email replies, please substitute the obvious.
  Réponse avec citation
Vieux 10/10/2006, 13h46   #4 (permalink)
Ottavio Caruso
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: persistent database connections?

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!

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.

Ottavio

  Réponse avec citation
Vieux 10/10/2006, 14h40   #5 (permalink)
Volker Hetzer
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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.
  Réponse avec citation
Vieux 11/10/2006, 13h30   #6 (permalink)
Ottavio Caruso
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: persistent database connections?

Volker Hetzer wrote:

> 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.


This is better done by a scripting language, eg. php:
http://de.php.net/session
or google "session handling and reuse"
How that applies to Oracle, I don't know and possibly this has not much
to do with Apache.

Ottavio

  Réponse avec citation
Vieux 11/10/2006, 15h43   #7 (permalink)
Volker Hetzer
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: persistent database connections?

Ottavio Caruso schrieb:
> Volker Hetzer wrote:
>
>> 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.

>
> This is better done by a scripting language, eg. php:
> http://de.php.net/session

Had a look. Looks like it's simply not possible. Apache thinks that
connections with the same user/password/database server are interchangeable,
which loses all session functionality from the database point of view.
And I didn't find any way for php processes/threads to share objects
so I can't build it on my own either.

> or google "session handling and reuse"

Tried it, there was a lot about j2ee, jsp and other buzzwords
but the idea appears the be the same all over.

I give up.

Lots of Greetings and Thanks to all who responded!
Volker
--
For email replies, please substitute the obvious.
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 01h12.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,14910 seconds with 15 queries