Earlier quoted context omitted.
It really isn't as easy as it sounds, is it? A better approach might be to UPDATE promo_codes SET used = 1 WHERE ... AND used = 0 , and then check that one update occurred. Or if your db supports it, SELECT ... FOR UPDATE OF ... and then update if the code is not yet used. You want the check and the update to occur atomically. And this varies depending on databases, for example in Oracle even if you explicitly begin…
I actually wasn't personally involved in the solution, but I believe that we went with something involving SELECT FOR UPDATE.
EA “Gives Away” 1000s Of Free Games Due To No Server-Side Validation
31–40 of 112 posts
Re: EA “Gives Away” 1000s Of Free Games Due To No Server-Side Validation
#32IANAL, but it's possible that these users are now liable to pay for the extra games. They knew that the code was only usable once, yet used it multiple times. EA might ask for the games back or charge the users. (I'm not taking EA's side, I'm just pointing out some possible consequences.)
Re: EA “Gives Away” 1000s Of Free Games Due To No Server-Side Validation
#33Re: EA “Gives Away” 1000s Of Free Games Due To No Server-Side Validation
#34Re: EA “Gives Away” 1000s Of Free Games Due To No Server-Side Validation
#35I'm really curious to see EA's response.
Re: EA “Gives Away” 1000s Of Free Games Due To No Server-Side Validation
#36(I apologize in advance for linking to my own blog, but I had not seen this issue reported on any tech blog nor appeared in the "new" queue on HN, so I wrote a quick post this morning on the issue, as it's technically interesting.)
Re: EA “Gives Away” 1000s Of Free Games Due To No Server-Side Validation
#37Re: EA “Gives Away” 1000s Of Free Games Due To No Server-Side Validation
#38Re: EA “Gives Away” 1000s Of Free Games Due To No Server-Side Validation
#39IANAL, but it's possible that these users are now liable to pay for the extra games. They knew that the code was only usable once, yet used it multiple times. EA might ask for the games back or charge the users. (I'm not taking EA's side, I'm just pointing out some possible consequences.)
The only sensible options are a) do nothing or b) revoke games purchased with these codes. If I were them I would do nothing and treat it as an unplanned pricing experiment. Since a lot of these games have an online component (network effects!) the "giveaways" might increase real sales overall.
Re: EA “Gives Away” 1000s Of Free Games Due To No Server-Side Validation
#40While at the same time trying to claw back the licenses.