Re: Flattened Relationships and stale data
Re: Flattened Relationships and stale data
- Subject: Re: Flattened Relationships and stale data
- From: Jean-François Veillette <email@hidden>
- Date: Thu, 7 Oct 2004 06:33:24 -0400
By design flattened relationship are a second path to access the same
set of data, but flattened relationship are not dynamic, they are a
static set of data. each path is cached independently in nsarray
(actually a nsarray-fault) when first visited (which explain why you
see correct values on restart). It is so by design, and be warned if
using flattened attributes / relationship of that it is not dynamically
resolved (not resolved on each invocation), it's not like a " sql view
".
To get consistent data, you have two choice :
1- avoir cache : do not use flattened relationship, do it dynamically
at runtime, building a custom accessor
2- manage cache : keep the flattened relationship, but invalidate the
content every time the source change.
- jfv
Le 04-10-06, à 19:56, Jake MacMullin a écrit :
I'm having a slight problem with flattened relationships and stale
data.
Here's my scenario:
A Course has many registrations and each registration has many
participants.
I've created a flattened relationship in Course defined as
'registrations.participants'
This kinda works. I launch my application and call
course.participants() - I
get back the list of participants associated with the registrations
for this
course - however if I then make any changes to a registration (add or
remove
a participant), it isn't *always* reflected in the flattened
relationship.
If I quit the application and launch it again, the flattened
relationship
contains the right participants again.
Is this just the nature of flattened relationships? Would I be better
off
adding a custom method to my Course class that gets the participants
from
each registration and combines them in to a single array, rather than
flattening the relationship in EOModeler?
Regards,
Jake MacMullin
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden