Re: [GENERAL] concurrent updates problem

2001-03-19 Thread mwaples
[snip junk] > [snipped code that looked simple enough to a non tcl-er] > > > > they both produces sometimes correct results, sometimes under what the > > result should be and sometimes over it. > > But 5 or 6 concurrent requests always produce the correct results, any > > more than that things go

Re: [GENERAL] concurrent updates problem

2001-03-19 Thread Tom Lane
[EMAIL PROTECTED] writes: > Im using aolserver - but its Im writing it in php later too. > code is below > set sql "BEGIN WORK" > ns_db exec $db $sql > set sql "SET TRANSACTION ISOLATION LEVEL SERIALIZABLE" > ns_db exec $db $sql > set sql "UPDATE threads set views = views + 1 WHERE forum_id = $

Re: [GENERAL] concurrent updates problem

2001-03-19 Thread Tom Lane
>> I have on a web application >> update threads set views = views + 1 where forum_id = 1 and thread_id = 1 It should work to do begin; select * from threads where forum_id = 1 and thread_id = 1 FOR UPDATE; update threads set views = views + 1 where forum_id = 1 and thread_id = 1; end; Note the

Re: [GENERAL] concurrent updates problem

2001-03-19 Thread Richard Huxton
[EMAIL PROTECTED] wrote: > > Richard Huxton wrote: > > > > From: <[EMAIL PROTECTED]> > > > > > I have on a web application > > > update threads set views = views + 1 where forum_id = 1 and thread_id = > > > 1 > Im using aolserver - but its Im writing it in php later too. > code is below [snippe

Re: [GENERAL] concurrent updates problem

2001-03-19 Thread mwaples
Richard Huxton wrote: > > From: <[EMAIL PROTECTED]> > > > 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. >

Re: [GENERAL] concurrent updates problem

2001-03-19 Thread Richard Huxton
From: <[EMAIL PROTECTED]> > 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 r

Re: [GENERAL] concurrent updates problem

2001-03-19 Thread Gavin Sherry
You should not be experiencing this if you are using transactions. Gavin On Mon, 19 Mar 2001 [EMAIL PROTECTED] wrote: > 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