Trouble with FK management in an Oracle environment


Author
Message
Kirk M Sherhart
Kirk M Sherhart
StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)
Group: Forum Members
Posts: 41, Visits: 259
I'm having trouble getting FK management working in an Oracle environment.



I notice that pre/post primary key value pairs are stored in the _PrimaryKeyPostPreSaveValues dictionary as decimals (which Oracle uses for all numeric values.) However, during the _DataLayer_AfterSave event, the procedure GetPostSavePrimaryKeyValue uses a Long value to look for the old PK value. Therefore, the old primary key value is not found, returning a null value.



Am I missing something?



Thanks!
Reply
Kirk M Sherhart
Kirk M Sherhart
StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)
Group: Forum Members
Posts: 41, Visits: 259
Hi Trent



Glad to help!



I also noticed that the pre/post primary key values are filled by accessing a DataRow, but the _DataLayer_AfterSave event looks at BusinessLayer objects. In my case with Oracle, I typically customize ID fields to return integers from the native decimal values. Therefore, the pre/post primary key values are stored as native decimal types (because that's what the datarow sees) . But, the fkValue coming through the BO is converted to an integer.



So, either get the pre/post primary key values from the datarow, and use datarows in _DataLayer_AfterSave or (vice versa) use values from the BusinessLayer.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search