PHP Classes

Downvotes

Recommend this page to a friend!

      Top level forums  >  Site  >  Features  >  Downvotes  >  (Un) Subscribe thread alerts  
Subject:Downvotes
Summary:Possible multi-post problem
Messages:6
Author:Dave Smith
Date:2016-02-29 14:15:34
Update:2016-03-02 00:40:54
 

  1. Downvotes   Reply   Report abuse  
Picture of Dave Smith Dave Smith - 2016-02-29 18:04:32
Refer the this request...

phpclasses.org/recommend/605-Trying ...

I down voted a recommendation. Since it took a long time to post, I figured I may have missed the submit button and pressed it again.

It appears that the comment posted once but the down votes is showing as 2.

Dave

  2. Re: Downvotes   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2016-02-29 19:16:00 - In reply to message 1 from Dave Smith
There are two down votes, one from you, so it shows -2.

  3. Re: Downvotes   Reply   Report abuse  
Picture of Dave Smith Dave Smith - 2016-02-29 20:10:36 - In reply to message 2 from Manuel Lemos
Now that you have down voted, I am seeing -3, before that it was -2 with just my one vote.

I am also seeing both clicks in my reputation points, however I only received credit for the one (as it should have been).

If you want to set up a test recommendation, I should be able to prove it with multiple clicks.

Dave

  4. Re: Downvotes   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2016-02-29 20:21:44 - In reply to message 3 from Dave Smith
Yes, I just found the records in the database. There are two votes from you with 11 seconds of difference. This shouldn't happen

I suspect this may be caused by the transaction isolation level that is not appropriate.

I need to investigate further and will get back on this later when I figure the problem and the solution. Thanks for reporting for now.

  5. Re: Downvotes   Reply   Report abuse  
Picture of Dave Smith Dave Smith - 2016-02-29 21:06:13 - In reply to message 4 from Manuel Lemos
Okay

When you do get a solution in place, let me know. The author of the one bad recommendation, recommended his package to another request for ajax and I can test it there, since I will be down voting again.

Dave

  6. Re: Downvotes   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2016-03-02 00:40:54 - In reply to message 5 from Dave Smith
Well for now I removed the duplicated vote records and added a unique index, so even if race conditions occur, the database will not allow duplicated vote records and an error occur.

The ideal solution would be to use the right transaction isolation level. I will add that later so the error never occurs.

Anyway, if you attempt to submit duplicated votes, it will either tell you already voted or will ignore it if there was an error.