concurrent updates problem

From: mwaples(at)waples(dot)net
To: pgsql-general(at)postgresql(dot)org
Subject: concurrent updates problem
Date: 2001-03-19 07:08:43
Message-ID: 3AB5B07B.904DDA1C@waples.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have on a web application
update threads set views = views + 1 where forum_id = 1 and thread_id =
1
just to record view for that page - stupid I know but people want it.
Problem comes when I use apache's ab to test it.

It just doesnt produce the correct result with 10 or so concurrent
connections. The views ends up being completely out.(no failed queries)
I read up on transaction Isolations , using select for update etc
but can't get it to work correctly - I thought serilizable might do the
trick but only few queries were rolled back -
Can anyone point me in the right direction to solve this ?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Poul L. Christiansen 2001-03-19 07:29:17 Re: Re: Migrating from MS SQL 7
Previous Message Alexander Jerusalem 2001-03-19 01:00:31 Re: Migrating from MS SQL 7