Re[2]: [INTERFACES] Sharing Database Connection...

From: "Alexey V(dot) Meledin" <avm(at)webclub(dot)ru>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: Re[2]: [INTERFACES] Sharing Database Connection...
Date: 2000-02-23 09:30:32
Message-ID: 9521.000223@webclub.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Hi,
Jim!

Wednesday, February 23, 2000, 12:00:37 AM, you wrote:

JL> Alexey,

JL> We're a bit short on details here, but I'll make some assumptions and
JL> have a go. If you have something like this:

JL> User login (e.g. "blue_eyes")
JL> \
JL> CGI script 1 sends query, e.g.
JL> \
JL> select first_name from users
JL> where login='blue_eyes';
JL> \
JL> returns "Anny"
JL> \
JL> (now here is the important part, does CGI1 _exec_ CGI2?
JL> If so, write "Hello, Anny" to CGI2 and do the HTML
JL> translation later.)
JL> \
JL> CGI script 2 sends query,
JL> \
JL> select nmsg from mail_list
JL> where login='blue_eyes';
JL> \
JL> returns 3
JL> \
JL> (now do the HTML translation)

JL> If you are trying to write something that will generate combinations of
JL> queries, that is, CGI1 + CGI3 might return:

JL> Hello, Anny. You have 134 minutes of free connect time left.

JL> It is not too hard if you generate sentences on the fly, pass them to
JL> successive scritps, then string them together at the end with an HTML
JL> generator.

JL> Then again, if this is completely off the track, feel free to disregard
JL> it. Good luck.

JL> Jim
Thanks for answer.
But each CGI script (CGI1-CGI2-CGI3) will call the backend and during
HTML generation there will be 3 backend processes started and 3 connection to
backend established :( Its very slow because of hard drive use.
Each CGI calls another via TCP Socket to httpd 80.

My assumptions are:
1. Write DAEMON that will serve all connections to PostgreSQL Backend.
At each connection DAEMON forks and serve the WWW Database
"TRANSACTION". Transaction has UID.
Each CGI script must know how to communicate with DAEMON (send and
receive queries).
When CGI calls another CGI it pass CONNECTION params where current
child daemon process is sittuated.
In other words I need a POOL for SQL QUERIES.
PS: Will it work? :)
PS2: May be someone knows something like this exept application
servers, that realy do that via Request Broker (I thing).

2. The second way is to Share Database Connection at the Database
Library level and pass Handle from one CGI to another (this like PS2).

Regards, Alexey V. Meledin
InterForge Developers Group, Saint-Petersburg
look_to: <www.etcompany.ru><www.businessweb.ru>
<www.inplan.spb.ru><www.pia.ru>>>>>>>>>>>>>>>>>
mail_to: <avm(at)webclub(dot)ru><nick_as: <cureman>>>>

Browse pgsql-interfaces by date

  From Date Subject
Next Message Dave Page 2000-02-23 10:11:46 RE: [INTERFACES] Visual Basic/Data Environment Designer/PgODBC
Previous Message Peter Mount 2000-02-23 09:11:54 RE: [INTERFACES] Last best version of the JDBC Driver?