Concurrenct problem -
12-03-2009
, 09:13 AM
Hi All,
On my web application(C#) we have a transaction and within the transaction we are calling a store procedure. And after the execution of store procedure we are committing the transaction.
Inside the store procedure we are fetching a value (an integer) from a column(table) and using the same value incremented by 1 we are updating the same column for the next record. THis works fine when users are hitting the SP at different times.
But when more than one user(say 2 users) trying to hit the store procedure at the same time, both the users are fetches the same value say 44567 from the table and updating it as 44568 for the next record, where it should be 44568 for the first record and 44569 for the second record.
PLeaseee help me out to handle this.
It would be really helpful if you could pull me out of this issue ASAP.
Submitted via EggHeadCafe - Software Developer Portal of Choice
ASP.NET Which Control Generated My PostBack?
http://www.eggheadcafe.com/tutorials...ntrol-gen.aspx |