Re: mysterious EOF problem: not inserting all fields
Re: mysterious EOF problem: not inserting all fields
- Subject: Re: mysterious EOF problem: not inserting all fields
- From: Jonathan Rochkind <email@hidden>
- Date: Tue, 6 Apr 2004 15:23:54 -0500
At 10:00 AM -1000 4/6/04, Art Isbell wrote:
On Apr 6, 2004, at 9:17 AM, Jonathan Rochkind wrote:
As an alternate question, if anyone is still reading: what's the
best way to enforce what I really want to do? That is, allow me to
specify a value for that attribute upon insert, but prevent any
code from _changing_ that value for an already inserted object?
As soon as you save the insertion, set the attribute to be
read-only programmatically.
Ah, that won't work, because the read-only setting applies to the
model as a whole. Just because I've saved one insertion, doesn't mean
later code wont' insert another object of this type. But if I've made
the attribute read-only, then it will cause problems when I insert
that next object. I suppose I could turn off read-only right before I
insert, then turn it back on----but multi-threading issues would
still worry me here (some other thread does something in that window).
Someone else suggested just plain using application logic in the
setter method for the attribute; throw an exception if setter method
is called when previous value is non-null or when setter method is
called with non-temporary GID. At first this seemed like a good
idea, but then I remembered that EOF has a habit of calling the
setter methods behind your back in surprising places, and throwing an
exception here might cause problems unless the logic for when to
throw was very carefully thought out. Nonetheless, I can't think of
a better solution except carefully thinking this out (Unless someone
else has already thought it out for me).
--Jonathan
Aloha,
Art
_______________________________________________
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.