Model::getLastInsertID retrieves the last inserted identifier from the current connection. Thus, it is safe until you paste from the same connection.
To make this a little more understandable, I believe that you need to think about how to provoke this error, because it is not so simple. Two different browsers on the same machine will use different connections. I'm not sure what should happen in the same browser with different tabs. As before, I never had this problem.
The safest way can be called by the store procedure, which returns the inserted identifier, but this is not a wireframe approach to do something.
source share