Print Page | Close Window

DataSourceKeyResolver identity insert issue

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=776
Printed Date: 11-Jun-2026 at 12:00am


Topic: DataSourceKeyResolver identity insert issue
Posted By: DataMan
Subject: DataSourceKeyResolver identity insert issue
Date 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
 



Replies:
Posted By: brentvee
Date Posted: 24-Jul-2008 at 12:40am
Thanks.

Was having the same issue, and this helped :)


Posted By: kimj
Date Posted: 25-Jul-2008 at 12:59pm
We've logged a bug report for this, thanks for bringing it to our attention.



Print Page | Close Window