Re: How do I refresh a many-to-many?
Re: How do I refresh a many-to-many?
- Subject: Re: How do I refresh a many-to-many?
- From: Chuck Hill <email@hidden>
- Date: Wed, 18 Apr 2007 15:08:29 -0700
On Apr 18, 2007, at 2:55 PM, Kevin Windham wrote:
I knew this would be a thorny issue, and I was hoping not to have
to deal with it. When fooling around with different ideas, I
decided to try adding the user to the club instead of adding the
club to the user.
addObjectsToBothSidesOfRelationshipWithKey
They should be equivalent.
Of course they shouldn't. That is why
addObjectsToBothSidesOfRelationshipWithKey (a) exists and (b) is
recommended.
Chuck
It turns out that in this case, adding the user to the club worked
as expected, even though the other way around didn't. I'm sure this
has something to do with the way the cache is handled and how
objects are tracked to be updated. Either way I'm glad that I don't
have to delve into this any deeper at this point because it seems
somewhat complicated and obtuse.
I appreciate all the pointers on what to do, I am saving them for
when this comes up again. I'm sure it will at some point.
Kevin
On Apr 18, 2007, at 1:59 PM, Mike Schrag wrote:
However, if you're doing all of these changes through a single
instance of a single wo app, then you should not need to care
about this. This is really only an issue you have multiple
instances or people changing your database behind your app's
back. If you are single instance/single app/single db access,
then you have some other problem going on.
ms
On Apr 18, 2007, at 2:54 PM, Robert Walker wrote:
http://developer.apple.com/documentation/WebObjects/
Enterprise_Objects/Fetching/chapter_6_section_7.html#//apple_ref/
doc/uid/TP30001011-CH206-BADDGFAG
This is a page that explains how to "Ensure Fresh Data."
Warning: It's not for the feint of heart. This is actually more
complicated that it initially seems. By default snapshots are
cached for 60 minutes. This is typically too long unless your
data is pretty static and stale data isn't a major problem.
In cases like your you will need to balance the benefits of the
snapshot caching and data freshness using the mechanisms
described in the above document.
The place to start is with the method on EOFetchSpecification
called setRefreshesRefetchedObjects(true);
On Apr 18, 2007, at 12:49 PM, Kevin Windham wrote:
I have an app with users and clubs. There is a many-to-many
between these objects. I allow one user to add another user to
their club through a page that fetches the particular user they
want to add and then calls the new users addToClubs method. This
much works fine. I can go look in my DB and see that the user
has been added. However, when I redisplay the original user's
club page, the new user does not show up. If I log out of the
app and log back in, the new user shows up.
I tried adding a refreshObject call on the original user, but
that doesn't seem to help. How can I refresh the many to many on
my original user?
Thanks,
Kevin
_______________________________________________
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
--
Robert Walker
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:
40mdimension.com
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:
40gatorgraphics.com
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:
40global-village.net
This email sent to email@hidden
--
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
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