c# - concurrency Control for inserting records based on previous transaction -


i having situation in have make entries tablea tableb such need counter-balance entries. example: tablea id name 1 2 b 3 c if no entries in tableb of table user,i add entries in tablea user1 as

id  tablea_id   userid 1       1       1 2       2       1    3       3       1 

for anther user user2, need check entries of lastuser , find out entry made first. entry made first made @ last next user. as

id    tablea_id   userid 1         1         1 2         2         1    3         3         1 4         2         2 5         3         2    6         1         2 

similiar next user enteries

7         3         3 8         1         3    9         2         3 

problem here users may request @ same time , need implement locking mechanism handle it. user's request, need find entries last user. table must locked until user makes entries in tableb. in short want control concurrency. please suggest how implement it. better if not effect entries tablec tableb.


Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -