> > For each page hit, I do this:
> >
> > update pagecounts set counter = counter + 1 where pagename = 
> 'testpag.php'
> >
> > Do I have to set a particular isolation level? Or does this not work in
> > general?
> 
> In read committed level, if the second update launches before the first
> update is finished (commits), then both of these updates will operate on
> the old counter value.  That is, you miss one page hit.

can you break it into this:

begin;
select counter from pagecounts where pagename='testpag.php' for update;
update pagecounts set counter=counter+1 where pagename='testpag.php';
commit;

Chris


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Reply via email to