ORMConcurrency exception with COM+ 1.5

Posts   
 
    
haacked
User
Posts: 2
Joined: 20-Oct-2005
# Posted on: 02-Feb-2006 19:21:04   

Hi all, I'm running into a problem I could use your help on. I'm running the following code in a unit test within MbUnit using the RollBack attribute. This effectively wraps the operation in a COM+ 1.5 transaction. However, I consistently get an ORMConcurrency exception with the following code. What is weird is that it seemed to work before, but stopped recently. I have banged my head against it too long.


IPredicateExpression selectFilter = new PredicateExpression();
selectFilter.Add(PredicateFactory.CompareValue(TournamentRosterRoundFieldIndex.TournamentRoundId, ComparisonOperator.Equal, this.Id));

TournamentRosterRoundCollection songPositions = new TournamentRosterRoundCollection();
songPositions.GetMulti(selectFilter);
DateTime exitDate = DateTime.Now;
foreach(TournamentRosterRoundEntity position in songPositions)
{
    position.DateExited = exitDate;
}
songPositions.SaveMulti(false);

I'm basically trying to change a property on every member of this collection. I get the error on the SaveMulti() command. Sometimes I get a Timeout on GetMulti. But there's not much data in the database, and this runs agains my local database, single threaded. I'm the only one accessing the database. Any ideas?

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 03-Feb-2006 07:32:49   

try to flag IsDirty = true.

foreach(TournamentRosterRoundEntity position in songPositions) { position.DateExited = exitDate; position.IsDirty = true; } songPositions.SaveMulti(false);

refer to the following long thread: (the last 3 posts should be enough) http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=4977