[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
[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 = $
>> 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
[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
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.
>
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
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