you need to check to see if the user has voted, and if so, the data is not inserted, and if not, the data is inserted. Under the condition of concurrency, it is possible for users to query not voting at the same time, and then result in the insertion of multiple pieces of data.
is there any good solution for such a situation?
as far as we know, transactions using databases do not lock select, so transactions may not solve such problems?
is it possible that only select for update is available? Is there any mainstream method