Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Concurrency Error when repeatedly saving field
Message
De
05/01/2007 18:37:47
Jeff Corder
Ambit Technologies, LLC
Missouri, États-Unis
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Concurrency Error when repeatedly saving field
Divers
Thread ID:
01183019
Message ID:
01183019
Vues:
86
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform