deadlock problem in Ad serving.. - Mailing list pgsql-admin

From Rajesh Kumar Mallah.
Subject deadlock problem in Ad serving..
Date
Msg-id 200301201418.54276.mallah@trade-india.com
Whole thread Raw
Responses Re: deadlock problem in Ad serving..  (Bhuvan A <bhuvansql@myrealbox.com>)
List pgsql-admin

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



pgsql-admin by date:

Previous
From: hubert baumgartner
Date:
Subject: security
Next
From: Bhuvan A
Date:
Subject: Re: deadlock problem in Ad serving..