Print Page | Close Window

IdGenerator Problem

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=2621
Printed Date: 15-Apr-2026 at 6:18pm


Topic: IdGenerator Problem
Posted By: gregweb
Subject: IdGenerator Problem
Date Posted: 14-Apr-2011 at 5:50pm
Every so often, I will get this error message:
 
IdGenerator problem - not all temp ids converted to permanent ids.
If you are using auto-incrementing ids check that the FixupTempIds SaveOption is set to InSaveListOnly.
 
If I ignore it, it seem to go away and everything seems to work ok.  This started recently after I changed the backend from MySQL to SqlServer.
 
I am using the usual Sql Server auto incrementing fields.
 
As per another post:
 
Here's a few places to look at:
- Check for partial saves; (i.e. SaveChangesAsync(listOfEntitiesToBeSaved) instead of SaveChangesAsync())
 
Not doing this.
 
- Check for multiple saves; (i.e. calling SaveChangesAsync() before a previous SaveChangesAsync() was completed)
 
The save is being done during the RPC and uses SaveChanges, not SaveChangesAsync();
 
- Check for server-side entity creation and saves (i.e. via any of the interceptors and/or RPC method)
This is true - I am creating a saving the entity on the server during an RPC call.
 
 
Greg



Replies:
Posted By: sbelini
Date Posted: 19-Apr-2011 at 12:26pm
Hi Greg,
 
in your RPC method, have you tried the suggestion from the error message?
i.e.
 
  ...
  var options = new SaveOptions();
  options.FixupTempIds = FixupTempIds.InSaveListOnly;
  mgr.SaveChanges(entitiesToBeSaved, options);
 
Silvio.
 


Posted By: gregweb
Date Posted: 22-Apr-2011 at 5:25am
Thank you, I will try that.
 
Greg


Posted By: sbelini
Date Posted: 26-Apr-2011 at 2:44pm
Hi Greg,
 
Just trying to touch base and check if the suggestion above, resolved the issue.
 
Silvio.


Posted By: gregweb
Date Posted: 26-Apr-2011 at 3:08pm
Yes, indeed, just got it implemented today an it works great!
 
Greg



Print Page | Close Window