Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Concurrency Error when repeatedly saving field
Message
From
05/01/2007 18:37:47
Jeff Corder
Ambit Technologies, LLC
Missouri, United States
 
 
To
All
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
Concurrency Error when repeatedly saving field
Miscellaneous
Thread ID:
01183019
Message ID:
01183019
Views:
85
This is really odd. I'm writing some tests where I change data (SQL Express), run the test, verify the results, change the data, repeat...

I get a concurrency error half the time I run the test. I'm using NUnit and the failure is the same if I run it in Visual Studio.

Here's the code that causes a problem:

BidsItems oBidsItem = new BidsItems();
.
.
.
// Retrieve data with BidFK = oBid.Entity.BidPK
oBidsItem.GetDataByFK("BidFK", oBid.Entity.BidPK);
.
.
.
oBidsItem.Entity.UnitPrice = 2.25M;
if (oBidsItem.SaveRow() != mmSaveDataResult.RulesPassed)
{
Console.WriteLine("BidsItem.SaveRow() Failed #1");
}


oBidsItem.Entity.UnitPrice = 2.75M;
if (oBidsItem.SaveRow() != mmSaveDataResult.RulesPassed)
{
Console.WriteLine("BidItem.SaveRow() Failed #2");
}


Obviously there was code between the saving of the business object, but I found that the problem was the same without any intervening code. Every other time I run the test, I get a 'Failed #2' message. Since I'm running through NUnit, there should be exactly 0 persistent objects.

If I change the second test column from UnitPrice to something else, it works fine. If I add a line to reload the business object before I change the UnitPrice to 2.75, it works fine. It's almost like the first change does not make it's way though the system.

Thanks for your help,
Jeff
Next
Reply
Map
View

Click here to load this message in the networking platform