Hi,
Problem: Some folks in my site are clicking two buttons at same time to request opposite operations, for example in Firefox one account clicks remove the thing I had put to sell, at exact same time in IE other account clicks I want to buy the product (normally its a "hacker" running both accounts on his computer and synchronizing both clicks).
Result: The product is sold but remove to the original account too making a duplication of product (known as duping).
Solution:
1) Change some field to 1 in DB saying that IP is working, when a request come from same IP and the field is still at 1, he is trying to dup - Doesn't work most of the times.
2) Lock tables - How can I lock tables from php to mysql and not cause a huge lag on server because of waiting request. (not to mention I will have to be very careful cause of deadlocks)
3) Its there a way to make a synchronize around the critical piece of code with wait/notify like I can do with java?
Thanks
Problem: Some folks in my site are clicking two buttons at same time to request opposite operations, for example in Firefox one account clicks remove the thing I had put to sell, at exact same time in IE other account clicks I want to buy the product (normally its a "hacker" running both accounts on his computer and synchronizing both clicks).
Result: The product is sold but remove to the original account too making a duplication of product (known as duping).
Solution:
1) Change some field to 1 in DB saying that IP is working, when a request come from same IP and the field is still at 1, he is trying to dup - Doesn't work most of the times.
2) Lock tables - How can I lock tables from php to mysql and not cause a huge lag on server because of waiting request. (not to mention I will have to be very careful cause of deadlocks)
3) Its there a way to make a synchronize around the critical piece of code with wait/notify like I can do with java?
Thanks