Query about entity framework transactions by multiple users

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
annapurna
Posts: 1
Joined: Mon 19 Sep 2011 12:09

Query about entity framework transactions by multiple users

Post by annapurna » Mon 19 Sep 2011 12:26

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?

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Thu 22 Sep 2011 11:19

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.

Post Reply