X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 5A148D9AA1 for ; Mon, 3 Oct 2005 19:25:49 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 55564-06 for ; Mon, 3 Oct 2005 22:25:43 +0000 (GMT) Received: from kyle.sinewave.com.au (kyle.sinewave.com.au [210.9.182.35]) by svr1.postgresql.org (Postfix) with ESMTP id 5EBB9D9ED1 for ; Mon, 3 Oct 2005 19:25:43 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by kyle.sinewave.com.au (Postfix) with ESMTP id 7661216E149 for ; Tue, 4 Oct 2005 08:25:43 +1000 (EST) Received: from kyle.sinewave.com.au ([127.0.0.1]) by localhost (kyle [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 03154-03 for ; Tue, 4 Oct 2005 08:25:38 +1000 (EST) Received: from wioota (mrscartman.hitwise.com [210.9.182.38]) by kyle.sinewave.com.au (Postfix) with ESMTP id D15FA16E152 for ; Tue, 4 Oct 2005 08:25:37 +1000 (EST) Reply-To: From: "Daniel Walters" To: Subject: Re: Trouble with conections between php and postgre Date: Tue, 4 Oct 2005 08:26:43 +1000 Organization: Hitwise MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook, Build 11.0.6353 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527 Thread-Index: AcXII892mAIPH7kzSB2c3vFtMv0fCAARHLcg In-Reply-To: <226b0df80510030659m39c4f7fdn@mail.gmail.com> Message-Id: <20051003222537.D15FA16E152@kyle.sinewave.com.au> X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at hitwise.com X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 required=5 tests=[none] X-Spam-Level: X-Archive-Number: 200510/8 X-Sequence-Number: 3276 =20 The lock is caused by PHP the page running the queries locking the = user's SESSION file. The php script execution suspends when running each query = so the lock remains. Subsequent page requests will all pause at session_start(); while waiting for the lock to be removed. A session_write_close(); (call it before any db_query is run) can be of assistance because it writes out the session file and thus no lock will = be kept. The problem is that this will send a cookie header to the client. Multiple calls send further cookie headers :( IE will die with an = unhelpful error page if it receives around 25 of these headers... What they really need to implement is a session_pause() and session_restart(). This has been suggested before and there was even documentation for these functions but it never made it into a PHP as far = I was aware and the documentation has since been removed from more recent = PHP documentation. A more permanent way around this might be to use a database to hold the sessions so you are not subject to the file-locking limitations. Alternatively you could overide the file based session handling with = your own implementation and choose to discard session data from pages if a = more recent page has tried to access the session. Regards, Daniel Walters -----Original Message----- From: pgsql-php-owner@postgresql.org = [mailto:pgsql-php-owner@postgresql.org] On Behalf Of luis linietsky Sent: Tuesday, October 04, 2005 12:00 AM To: pgsql-php@postgresql.org Subject: [PHP] Trouble with conections between php and postgre Hi !, first of all: sorry about my english, i'm not from us. I 'm using latest versions of postgre 7.4 with php4 and apache2, on a = debian system. I'm working with a really big database, so there are many querys that takes too much time to be executed (And there's nothig to do about = it). These querys blocks the php page while's being loaded. The problem is = that usually, one excepcts to stop those querys or even close the conection = if the user stops the explorer or closes the window. However, this isn't hapening, the query keeps running in the database, using resources. I already try uselessly ignore_user_abort(False), and I don't want to = set a time limit. =BFAny ideas? =BFAm I missing something ? Thnxs ! (Please, try avoiding those messages like "Get more resources", = "Optimize your querys", "/etc/init.d/postgresql restart", etc.) ---------------------------(end of broadcast)--------------------------- TIP 5: don't forget to increase your free space map settings