I have a situation with multiple db connection:
db connection 1: INSERT xyz (very short time passes) db connection 2: SELECT [looking for xyz]
Sometimes SELECT finds xyz , and sometimes not (because it is on a different db connection than INSERT ). If I put sleep(1) after INSERT then the SELECT will always find xyz .
To connect db 1, how can I make it wait for INSERT end and a new line is available for SELECTs running on another db connection?
My innodb table. A use case is to insert the identifier of the authenticated connection 1, then redirect to the authentication page, and then, when the request for the authenticated page arrives (in another connection), we look for the session identifier for authenticating the request. This is normal if we slow down the login a bit and do it until the INSERT is completely completed so that the identifier of the verified one is available to other requests before returning.
source share