Page 1 of 1

Query about entity framework transactions by multiple users

Posted: Mon 19 Sep 2011 12:26
by annapurna
I have one table Customer with uniqueid as customer id in mysql.
And also i am using ultragrid in UI to add rows.

In my application,when one user click on Add Customer,i am adding new row by generating Uniqueid and add into Customercontext.addtocustomers(custentity).

At the same time if other user clicks on AddCustomer,here also same customer uniqueid will be genearted.

Here i am calling Customercontext.Savechanges() method at the end when user clicks on Save button.

how can i handle these unique ids ?is there any way to provide Locks,when multiple users are using same application?

Posted: Thu 22 Sep 2011 11:19
by Shalex
Try using AUTO_INCREMENT for the primary key column in your database and setting StoreGeneratedPattern=True for this column in the SSDL part of your model: http://www.devart.com/forums/viewtopic.php?t=18620.