Print Page | Close Window

How can I obtain the default persistence order of entities?

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=4449
Printed Date: 26-Apr-2024 at 6:09am


Topic: How can I obtain the default persistence order of entities?
Posted By: ctoth
Subject: How can I obtain the default persistence order of entities?
Date Posted: 02-Oct-2013 at 4:55pm
There's a corner case when we may need to tinker 3 entity's persistence order (long story short: in case of merge replication with static partitions, replication filters are evaluated when the insert trigger kicks in, and not when the merge synchronization happens. This causes missing entities in case of entities connected by association classes. IdeaBlade's order is logical but unfortunately it interferes with this particular type of merge replication setup, which is - needless to say - deployed in many places right now).

Let me say that I'm very happy that DevForce Classic is not as "advanced" as DevForce, and there's at least a chance to influence the save order, since that could be the most obvious fix to our problems, any other solution would be a bigger hack. So I bumped into this:
http://www.ideablade.com/forum/forum_posts.asp?TID=1961 - http://www.ideablade.com/forum/forum_posts.asp?TID=1961

I'm looking at ting's comment: "Manually specifying the order for all types is a hassle, as you noted.  You can call get on PersistenceOrder to get the default ordering of types first, then move the few that are problematic to the correct location, and finally call set on PersistenceOrder to use the corrected ordering."

I can get hold of the IdeaBlade's DefaultSaveOptions object, but the PersistenceOrder property is empty.
Any help would be appreciated.




Replies:
Posted By: kimj
Date Posted: 02-Oct-2013 at 7:47pm

You can call SaveOptions.GetDefaultPersistenceOrder to retrieve the list of types.  Then modify as needed, and store back into the SaveOptions with either the SetPersistenceOrder() method or the setter on the PersistenceOrder property (why this API is so "unusual" I don't really know).



Posted By: ctoth
Date Posted: 03-Oct-2013 at 8:09am
Thanks, I see now. I forgot to uncheck "Whole word only"when I searched for "PersistenceOrder" :P



Print Page | Close Window