Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to handle Transaction table locking
Message
 
 
To
14/08/2008 00:20:57
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
VB.NET 1.1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01338771
Message ID:
01338783
Views:
11
From what is see there is a "UniqueConstraint "... so you have some fields that has a UNIQUE index or maybe it's the primary key...

Have you checked that the data that you are trying to save does not have some non-unique data?

I had a similar situation maybe you have the same - I have a table with a unique field...
users can enter whatever they wish in this textbox, but in the validation method I'm checking that what they have entered does not exist in the table, if it exists I'm telling them that this code already exists...

The problem is when two users are adding new data at the same time they might enter the same code for this field... in the validation for this field I will get all OK, because this data is still not in the table...

What happens is that first person that clicks save will succedd to save.... but the second person that clicks save will get the UniqueConstraint...

If you have something like this... you can use the HookPreSave to check once more for the uniqueness of the fields that has UNIQUE indexes..
---------------------------
Maurizio Domba
CRON d.o.o. Rovinj, Croatia
http://wanip.info
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform