▲ | branko_d 3 days ago | ||||||||||||||||
“Running 4 SQL queries in parallel” is not thread-safe if done in separate transactions, and on data that is not read-only. If some other transaction commits at just the wrong time, it could change the result of some of these queries but not all. The results would not be consistent with each other. | |||||||||||||||||
▲ | frollogaston 3 days ago | parent [-] | ||||||||||||||||
Thread-safe just means that the threading by itself doesn't break anything. The race condition you're describing is outside this scope and would happen the same in a single-threaded event loop. Btw if you really want consistent multi reads, some DBMSes support setting a read timestamp, but the common ones don't. | |||||||||||||||||
|