this newsgroup is a joy to behold
that was one of the sweetest exchanges i have ever seen
get a room!
and why not read to each other from a book about database locking?
oh and make sure to buy a big hard disk to store all those hitcounter
records, they will make great reading:
1 hit
2 hit
3 hit
4 hit
5 hit
6 hit
....
12,234,154 hit
12,234,155 hit
ha ha ha ha ha
brilliant
you guys are the best
oh no! what happens if the hit counter is updated after the first
user comes but before the first user receives the html?
he will see a number out by one!!!! thats deception!!!!
maybe we can implement a distributed transaction coordinator
to make sure that the users eyes have processed the information
and their brain has fully understood it before updating the hit
counter and releasing a page to another user
oh no! what if google spiders the page???? should we include
that in the count??? maybe just half a hit? or should we make
a new table to keep track of googles hits??? maybe we should ring
google now and ask ... but we want to track whether the user
is male or female, lets ask them to fill in their telephone number
so we can ring and ask!! maybe we can just dial their ip address ...
i'm sure it will work
dee wrote:
Marina
Thanks for your suggestion.
Appreciative your help.
Dee
"Marina" <so*****@nospam.com> wrote in message
news:Ov**************@TK2MSFTNGP12.phx.gbl... You should put this in a transaction. That way, as soon as one user has
updated the total the row in whatever table keeping that total will become
locked. The second user's thread will wait until the first user's
transaction has finished before it will proceed.
The other way, is to synchronize access to the block of code updating the
hit counter by using Monitor.Enter/Monitor.Exit. I think there is also a
Lock statement that lets you lock on an object.
"dee" <de*@home.net> wrote in message
news:OE*************@TK2MSFTNGP10.phx.gbl... Hi
I just implemented a hit counter. I lookup the value from an access
database table and then increment and update the result to databse. What
happens if two users access this code at the same time? Is there locking
in aspnet?
Thanks.
Dee