Quantcast
Channel: MySQL Forums - InnoDB
Viewing all articles
Browse latest Browse all 1957

Tricky problem with parallel update of table. (no replies)

$
0
0
Good day.

I have tricky problem which I'm struggling to get right.
I have the following situation:
1) InnoDB database
2) There is a table "licences" which has encrypted string "lics" in it.
3) I have code which grabs that string, decrypts it, deducts a license, encrypts it again, updates that table with new encrypted string.

The problem is that if 5 users execute this code at the same time, only 1 license deduction happens.

How can I get this right so all 5 licenses are deducted even when 5 users run that code at exactly the same time?

Thanks.

Viewing all articles
Browse latest Browse all 1957

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>