Received: from holmes.infopro.spb.su (holmes.infopro.spb.su [195.242.2.2]) by hub.org (8.9.3/8.9.3) with ESMTP id EAA89091 for ; Tue, 22 Feb 2000 04:45:56 -0500 (EST) (envelope-from avm@webclub.ru) Received: from barrymore.peterlink.ru (barrymore.peterlink.ru [195.242.2.8]) by holmes.infopro.spb.su (8.9.1/8.9.1) with ESMTP id MAA29240 for ; Tue, 22 Feb 2000 12:45:53 +0300 (MSK) Received: from turtle.interforge.ru (spb-2-81.dialup.peterlink.ru [195.242.11.81]) by barrymore.peterlink.ru (8.9.1/8.9.1) with ESMTP id MAA26218 for ; Tue, 22 Feb 2000 12:45:47 +0300 (MSK) Date: Tue, 22 Feb 2000 12:46:21 +0300 From: "Alexey V. Meledin" X-Mailer: The Bat! (v1.36) S/N F29DEE5D / Educational Reply-To: "Alexey V. Meledin" Organization: InterForge Developers Group, Spb X-Priority: 3 (Normal) Message-ID: <7532.000222@webclub.ru> To: pgsql-interfaces@postgresql.org Subject: Sharing Database Connection Among Different CGI scripts writen in different languages In-reply-To: <1B3D5E532D18D311861A00600865478C70C232@exchange1.nt.maidstone.gov.uk> References: <1B3D5E532D18D311861A00600865478C70C232@exchange1.nt.maidstone.gov.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi! I have 2 CGI scripts. Each script makes some queries to PostgreSQL and returns html code as a result . Simple example: 1-st CGI returns: "Hello, Anny!" (Anny is choosen from DataBase) 2-nd CGI returns: "There is 3 messages for you!" (nu,ber of messages is choosen from Database) Scripts can run separately each from other. Suppose, that I want to call 2-nd script from the first via HTTP or fork+execv+pipe. I receive: "Hello, Anny! There is 3 messages for you!" All OK, but I have two separated queries and two Backends started. It's not good, because I don't need any concurrency :( How can I optimize such situation? I see: 1. Share Database conection among two scripts. Can I do it? 2. Write "proxy" daemon to execute queries. Is it possible? 3. Use Application Servers and so either (can't use them and any other transaction mechanizm) Thenks, Alexey V. Meledin InterForge Developers Group, Saint-Petersburg look_to: >>>>>>>>>>>>>>>> mail_to: >>>