When I searched up @@IDENTITY with MySQL it is said that MySQL uses the function LAST_INSERT_ID() *Which I was using* and that its based on the connection.

I put it to the test, opened up my application twice, one each with different user. Inserted into records in app1 then app2. After running the query SELECT LAST_INSERT_ID() I found that it differed from each user.

What I am getting to is that LAST_INSERT_ID() is based on that users insert and not the database. So, no table locking is required and now my headache is gone.

I hope this may in future be a lesson for all. Test before questioning.

Thanks for pointing me in the right direction szlamany