Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id F0C74475D6E for ; Mon, 20 Jan 2003 03:43:54 -0500 (EST) Received: from rtlocal.trade-india.com (mail-relay.trade-india.com [203.196.129.235]) by postgresql.org (Postfix) with SMTP id 911C8475D22 for ; Mon, 20 Jan 2003 03:43:47 -0500 (EST) Received: (qmail 24950 invoked from network); 20 Jan 2003 08:38:58 -0000 Received: from unknown (HELO system67.trade-india-local.com) (192.168.0.67) by infocom-236-129-del.trade-india.com with SMTP; 20 Jan 2003 08:38:58 -0000 From: "Rajesh Kumar Mallah." Organization: Infocom Network Limited. To: pgsql-admin@postgresql.org Subject: deadlock problem in Ad serving.. Date: Mon, 20 Jan 2003 14:18:54 +0530 User-Agent: KMail/1.5 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200301201418.54276.mallah@trade-india.com> X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/202 X-Sequence-Number: 7044 Hi, I use postgresql in serving Ads and counting impression of the ad banners. whenever an Ad is served I do a update. update banner_stats set imp=imp+1 where uniqid=4330 in a transaction. In a busy web environment like ours there are high chances that the same page is displyed concurrently to two different viewers. I have been able to verify using two psql sessions that unless one transaction commits the update, the update from the second client (also in a transaction block) keeps wating to happen. as a result such updates get queued up and i finally get "dead lock detected" error. ~~~~~~~~~~~~~~~~~~~~~~ Error: DBD::Pg::st execute failed: ERROR: deadlock detected at /usr/local/perlapache/lib/perl/Banner.pm line 71, line 7. ~~~~~~~~~~~~~~~~~~~~~~ can anyone tell me how shud i go ahead tosolve this problem regds mallah. -- Rajesh Kumar Mallah, Project Manager (Development) Infocom Network Limited, New Delhi phone: +91(11)6152172 (221) (L) ,9811255597 (M) Visit http://www.trade-india.com , India's Leading B2B eMarketplace.