I am creating a very simple project in java and postgresql of clients and contacts between clients.
There is the clientes
table with id and name, and the contatos
table with id1 and id2 that refer to clients.
What happens if a thread with a connection makes a SELECT containing all the contacts of a certain client exactly at the same time as another thread with another connection does an INSERT or DELETE?
And yet another case, if I have a "saved procedure" that makes several different selects and updates and two threads perform the same procedure? Is there any guarantee of order?