We have been testing out an implementation of IDataSourceKeyResolver recently and all appeared to be working perfectly until we attempt to save changes on newly created Entities. We consistently get this Exception:
IdGenerator problem - not all temp ids converted to permanent ids./nIf you are using auto-incrementing ids check that the FixupTempIds SaveOption is set to InSaveListOnly./nThis may also occur if your custom IIdGenerator was not found or its GetRealIdMap method did not/nprovide a corresponding real id for each temp id.
As soon as we disable the IDataSourceKeyResolver implementation and go back to the config files for the edm keys all is well.
This is the IDataSourceKeyResolver implementation we have been testing with:
[Serializable]
internal class SessionDataSourceKeyResolver : IDataSourceKeyResolver
{
public IDataSourceKey GetKey(string keyName, string keyExtension, bool onServer)
{
string connString = SystemSettings.GetConnectionString(SystemConnectionType.System).ConnectionString;
string provider = SystemSettings.DataProvider;
string container = GetContainer(keyName);
string edmx = "metadata=res://*/DataModel.{0}.csdl|res://*/DataModel.{1}.ssdl|res://*/DataModel.{2}.msl;provider={3};provider connection string=\"{4};MultipleActiveResultSets=True\"";
string devConn = String.Format(edmx, new object[] { container, container, container, provider, connString });
return new ClientEdmKey(keyName, devConn, ("PBI.Workspace.DataModel." + container), false, new string[] { "PBI.Workspace" }, "", new string[] { });
}
}
Any feedback is much appreciated.