table :employee
Fields: eid(primary key ), empno(unique key), empname
here the empNo is manually generated in the code for Ex. Accounts001.. when 2 users enter employee data with 0 time difference. During 'Add' the emp num generated for both the inserts will be same i.e., Accounts001 and Accounts001, whereas, it should be unique i.e., Accounts001 and Accounts002..
When the add is done.. the unique key constraint acts just fine.. even though the manually generated empno is same. the db is updated with unique numbers..
I would like to know how exactly does mysql handle this condition as the empno is generated by us manually.. does it come back to the code n regenrate or queue up the request?
I hope the question is clear..
Thanks in advance