Re: Deleting shared EOs?
Re: Deleting shared EOs?
- Subject: Re: Deleting shared EOs?
- From: Chuck Hill <email@hidden>
- Date: Wed, 30 Jun 2004 11:51:14 -0700
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._processObjectStoreChan
ges(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.jav
a:59)
at
com.webobjects.eocontrol.EOEditingContext._sendOrEnqueueNotification(EO
EditingContext.java:3962)
at
com.webobjects.eocontrol.EOEditingContext._objectsChangedInStore(EOEdit
ingContext.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.