dbTalk Databases Forums  

Concurrenct problem

microsoft.public.sqlserver.clients microsoft.public.sqlserver.clients


Discuss Concurrenct problem in the microsoft.public.sqlserver.clients forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Priyadarshan V
 
Posts: n/a

Default 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

Reply With Quote
  #2  
Old   
Scott Morris
 
Posts: n/a

Default Re: Concurrenct problem - 12-03-2009 , 01:41 PM






Answered in .programming. Please do not post the same message independently
to multiple newsgroups.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.