New Posts New Posts RSS Feed: Custom DataSourceKeyResolver Issue
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Custom DataSourceKeyResolver Issue

 Post Reply Post Reply
Author
robdrye View Drop Down
Newbie
Newbie
Avatar

Joined: 05-Aug-2009
Posts: 22
Post Options Post Options   Quote robdrye Quote  Post ReplyReply Direct Link To This Post Topic: Custom DataSourceKeyResolver Issue
    Posted: 04-Mar-2010 at 6:05pm
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.
Back to Top
ting View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 27-Mar-2009
Location: San Francisco
Posts: 427
Post Options Post Options   Quote ting Quote  Post ReplyReply Direct Link To This Post Posted: 05-Mar-2010 at 4:25pm
Hi robdrye - We received your email and will follow up with you there.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down