New Posts New Posts RSS Feed: DataSourceKeyResolver identity insert issue
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

DataSourceKeyResolver identity insert issue

 Post Reply Post Reply
Author
DataMan View Drop Down
Groupie
Groupie
Avatar

Joined: 26-Jul-2007
Location: Canada
Posts: 52
Post Options Post Options   Quote DataMan Quote  Post ReplyReply Direct Link To This Post Topic: DataSourceKeyResolver identity insert issue
    Posted: 18-Apr-2008 at 4:45pm
I'm posting this so if someone else has this same issue they won't spend 4 days of debugging to figure out identity columns were not changing from -100 to a positive number when being saved to the table.  Here's the situation:
 
Have a ibconfig file that has the following line:
 
<rdbKey name="default" databaseProduct="Unknown">
<connection>Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=xxxx;Data Source=yyyyy</connection>
<probeAssemblyName>Model</probeAssemblyName>
</rdbKey>
 
Notice that it's name is "default"
 
Then I had a IDataSourceKeyResolver like the following:
 
public IDataSourceKey GetKey(string pKeyName, string pKeyExtension)
{
ConnectionStringNew = "Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=xxxx;Data Source=xxxx\serverhere"
return new IdeaBlade.Rdb.RdbKey("Live", ConnectionStringNew);
}

Because the ibconfig file said "Default" and the IDataSourceKeyResolver said "Live" my SQL identities were not working properly and storing as negative (-) numbers.

When I changed the resolver to match the config file everything worked fine.
 
The hard part to debug this is that I added this line in to the getentities code

RdbKey key = (RdbKey)mPersMgr.DataSourceResolver.GetDataSourceKey("Employee");

And when I created a watch on the key it would return looking like everything was ok.  The dataprovider was set as SQL.
 
Just posting this so someone else with this issue won't have to go though the "Fun" I did!
 
Thanks
 
Back to Top
brentvee View Drop Down
Newbie
Newbie


Joined: 22-Jul-2008
Location: RSA
Posts: 2
Post Options Post Options   Quote brentvee Quote  Post ReplyReply Direct Link To This Post Posted: 24-Jul-2008 at 12:40am
Thanks.

Was having the same issue, and this helped :)
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 25-Jul-2008 at 12:59pm
We've logged a bug report for this, thanks for bringing it to our attention.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down