c# - user id is Mxing when submit a form by two users at two computer at same time -


we have client application more ten users can perform same actions @ same time filling form, issues comes when 2 users @ same time submit same form different data's both data saved user clicked millisecond after other user have been placing userid in session, , tried placing userid in user.identy.name , cookies result same please me! :)

code:

getcustomerdetails()  {      customer_details custdetails = new customer_details();      custdetails.name = txtname.text.trim();      return custdetails;  }   getentrepreneurshipdetails()  {      entrepreneurship entre = new entrepreneurship();      ...      entre.advid = guid.parse(session["userid"].tostring());      return entre;  }   btnsubmit_click  {      var custdetails = getcustomerdetails();      var = getentrepreneurshipdetails ();     _advisorservice.insertentreprenuershipdetails(custdetails, entreprenuershipdetails);  } 

you'll need implement sort of versioning check.

i create timestamp field on table (a date time), automatically updated rdbms every time data saved in record.

so, when user comes edit record, read value , keep it. when user confirm operation, inside isolated transaction, compare previous read timestamp value current one

  • if both equal, save new values (thus no data has been changes on record)
  • otherside, return alert current user, stating he/she need re-do operation, else changed data recently

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -