On Nov 5, 2009, at 2:33 PM, Mark Gowdy wrote:

Hi,

I am having an strange problem with Wonder's clearSnapshotForRelationshipNamed method.

Is this new code, by chance?


(My Wonder version is a few days old)

We have EOs which are related to each other:
RoutingMediaItem   <<--->   RoutingMediaStatus

When I try to get an up-to-date status object and check the results using:

ERXEOControlUtilities .clearSnapshotForRelationshipNamed(routingMediaItem, RoutingMediaItem.TO_ONE_STATUS);

That method is to clear the snapshot for a to-many relationship, not a to-one. For a to-one, just invalidate the object.

I think this is what you want:

routingMediaItem .editingtContext().refreshObject(routingMediaItem.toOneStatus())


Chuck





AELog.dbg("- routingMediaItem.status() class = " + routingMediaItem.status().getClass().getName()); AELog.dbg("- routingMediaItem.status().descr() = " + routingMediaItem.status().descr()); // This is line 100 of RoutingMediaBatch, and descr() is a normal string

The first debug prints what you would expect:
- routingMediaItem.status() class  = RoutingMediaStatus

The second line explodes with:
java.lang.ClassCastException: RoutingMediaStatus
at com .webobjects .eoaccess .EODatabaseContext.objectsForSourceGlobalID(EODatabaseContext.java: 3880) at com .webobjects .eocontrol .EOObjectStoreCoordinator .objectsForSourceGlobalID(EOObjectStoreCoordinator.java:634) at com .webobjects .eocontrol .EOEditingContext.objectsForSourceGlobalID(EOEditingContext.java:3923)
        at er.extensions.eof.ERXEC.objectsForSourceGlobalID(ERXEC.java:1182)
at com .webobjects .eoaccess.EODatabaseContext._fireArrayFault(EODatabaseContext.java: 4245) at com .webobjects .eoaccess .EOAccessArrayFaultHandler .completeInitializationOfObject(EOAccessArrayFaultHandler.java:77) at com.webobjects.eocontrol.EOCustomObject.willRead(EOCustomObject.java: 1172) at com.webobjects.eocontrol._EOMutableKnownKeyDictionary$Initializer $ _GenericRecordBinding .valueInObject(_EOMutableKnownKeyDictionary.java:570) at com .webobjects .eocontrol.EOCustomObject.storedValueForKey(EOCustomObject.java:1634)
        at _RoutingMediaStatus.descr(_RoutingMediaStatus.java:39)
        at RoutingMediaBatch.cancel(RoutingMediaBatch.java:100)

I am a little confused as to what I am doing wrong here (or what I have broken). I thought it might have been some weird AJAX thing, but I replace the AJAX links with normal ones but the problem persists.

Regards,

Mark
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net

This email sent to [email protected]

--
Chuck Hill             Senior Consultant / VP Development

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 protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to