SQLite Forum

Why do you assume that a race condition exists (or can exist) that you need to (or can) mitigate in any way whatsoever?

You are not opening a file, you are opening a database.  If in the process of opening a database there is a race condition against the underlying file, that would be a bug in the SQLite3 library.

Just because you *want* to your car to be yellow to avoid it being green, where the car manufacturer does not sell green cars, is not a valid reason for wanting a yellow car.  No matter what you do, you will not get a green car, so why bother specifying a colour at all if all you want to do is avoid getting a green car, which the car manufacturer cannot sell to you anyway?

It sounds like you expending extra cycles in what is commonly called "premature optimization".  

In other words, you are expending effort in avoidance of a problem which does not yet exist (and which cannot exist).