New Posts New Posts RSS Feed: How can I obtain the default persistence order of entities?
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

How can I obtain the default persistence order of entities?

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

Joined: 04-Mar-2013
Location: Fresno, CA
Posts: 22
Post Options Post Options   Quote ctoth Quote  Post ReplyReply Direct Link To This Post Topic: How can I obtain the default persistence order of entities?
    Posted: 03-Oct-2013 at 8:09am
Thanks, I see now. I forgot to uncheck "Whole word only"when I searched for "PersistenceOrder" :P
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: 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).

Back to Top
ctoth View Drop Down
Newbie
Newbie
Avatar

Joined: 04-Mar-2013
Location: Fresno, CA
Posts: 22
Post Options Post Options   Quote ctoth Quote  Post ReplyReply Direct Link To This Post 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

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.



Edited by ctoth - 02-Oct-2013 at 4:57pm
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down