K
K
Kirill Petrov2016-12-21 12:54:07
PHP
Kirill Petrov, 2016-12-21 12:54:07

How to set "strict sequence" in mysql? Can set the transaction queue as a thread?

This is such an unfortunate situation. Applications fall into the database, but before adding a new application, it is checked whether there is the same one with the same number for the last hour. The script that makes requests to the database works asynchronously. And sometimes the database gives in both almost simultaneous requests the result that there is no application with this number and the script inserts data in both cases.
I would like all applications to reach, be checked for duplicates and not get lost...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
U
ukoHka, 2016-12-21
@Recosh

MySQL has a locking mechanism .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question