Answer the question
In order to leave comments, you need to log in
Can two programs work with the same database?
Hello. Is it possible to organize the work of two programs with the same database in such a way that when queries from one program are executed, the database is locked and the second program waits until the work of the first program with the database ends? I'm afraid that both programs do not receive the same data. Are there any methods for MySQL and sqlite?
Answer the question
In order to leave comments, you need to log in
Both programs receive data from the database and work with them. So I want to exclude the possibility of obtaining the same data by both programs. Now I use using in my code and open a connection in it. Next, we get the data, in a certain column of the table I mark that the data has been taken, which indicates to the second program that it should no longer take this data.
SQLite locks on open by default, while MySQL has locks .
Locks are different, for reading/writing, for different entities - string/table/base. The specifics should be clarified from docks to a DBMS.
I'm afraid that both programs do not receive the same data.what does this mean, why is it causing a problem? Explain.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question