hello.
I am using IDENTITY to auto-generate my ID in one of my tables
and using CALL IDENTITY() to get back the newly created ID.
However, as I am doing this over a network. I noticed that my
JDBC code
executes CALL INDENTITY() before my INSERT INTO ... statement is completed and thus returning the the incorrect ID.
when I put a sleep() for 5 sec, everything works fine. So I suppose its a problem with concurrency issue.
I am wondering is there any method to ensure when I call the CALL IDENTITY() function, it will return me the correct id ? A method that when updating the database, the CALL IDENTITY will be blocked before the INSERT statement is completed ?
Thank you