Re: Deleting shared EOs?
Re: Deleting shared EOs?
- Subject: Re: Deleting shared EOs?
- From: Chuck Hill <email@hidden>
- Date: Wed, 30 Jun 2004 14:12:22 -0700
I don't know if it works in later versions, I've never tried to do this.
Chuck
On Jun 30, 2004, at 2:09 PM, Colin Clark wrote:
Hey Chuck,
Thanks for the quick response. I had tried working around it with
forgetObject(), but with no luck.
So does this work correctly in 5.2? I know there have been a number of
fixes to shared ECs since 5.1.
Colin
On Wednesday, June 30, 2004, at 02:51 PM, Chuck Hill wrote:
Sounds like a bug to me.
As a hack around you could try
sharedEC.forgetObject(objectToBeDeleted);
before saving the delete. I don't know if that will work or not.
Chuck
On Jun 30, 2004, at 11:24 AM, Colin Clark wrote:
Hi everyone,
A quick question about deleting shared objects. I have some objects
in my application that change very infrequently. They're displayed
regularly by a wide variety of users, and are only occasionally
edited at all. Perfect case for a shared editing context. On rare
occasions, however, these objects can actually be deleted by an
administrative user.
I understand that EOSharedEditingContexts are essentially
read-mostly object stores, and that in order to make changes to a
shared object, it needs to be refetched into an EC whose
sharedEdtingContext() has been set to null.
This works fine for me when modifying existing shared objects in my
application using WebObjects 5.1. Clearly, the shared editing
context picks up the change notification and adjusts its values
accordingly. However, when I try to delete an object, the
EOSharedEditingContext chokes trying to process the change. A
NullPointerException is thrown in
EOSharedEditingContext._processObjectStoreChanges(). I've included
the relevant portion of the stack trace below.
So, given this problem, I have a few questions:
1. Is it possible to delete shared objects at all?
2. Is this the correct way to do it?
3. Is this just a bug in WO 5.1?
I appreciate any input anyone may have about this, particularly
during the busy WWDC week this week. I wish I could have been there
this year!
Best,
Colin
-------------------
Stacktrace while trying to delete shared objects from a separate
editing context:
java.lang.NullPointerException
at
com.webobjects.eocontrol.EOSharedEditingContext._processObjectStoreCh
anges(EOSharedEditingContext.java:363)
at java.lang.reflect.Method.invoke(Native Method)
at com.webobjects.foundation.NSSelector.invoke(NSSelector.java:296)
at
com.webobjects.foundation.NSSelector._safeInvokeSelector(NSSelector.j
ava:59)
at
com.webobjects.eocontrol.EOEditingContext._sendOrEnqueueNotification(
EOEditingContext.java:3962)
at
com.webobjects.eocontrol.EOEditingContext._objectsChangedInStore(EOEd
itingContext.java:2864)
---
Colin Clark
Dynamic Web and Database Lead,
Resource Centre for Academic Technology,
University of Toronto
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
---
Colin Clark
Dynamic Web and Database Development Lead,
Resource Centre for Academic Technology,
University of Toronto
(416) 946-7592 / email@hidden
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.