On 31/05/2007, at 8:15 AM, Chuck Hill wrote:

On May 30, 2007, at 12:57 PM, Steven Mark McCraw wrote:

B) Programmatically constrain programmers to follow those rules. Since changing the state of an object is so catastrophic if the object is not in the pool that enables it to be tracked, why not throw an exception when that condition is encountered, rather than just letting the programmer proceed and wander into the terrible limbo of a hosed database context and all sorts of strange, untraceable and difficult to reproduce behavior?

I have often wondered that. Now you have gone and provoked me. I will file a bug report. You _can_ do this yourself by adding this to your base EO class:

 public void willRead() {
        if (editingContext() == null) {
throw new IllegalStateException("Access of instance of " + entityName() + " that has not been inserted into an EOEditingContext or whose EOEditingContext has been disposed");
        }
        super.willRead();
}

perhaps willChange and willReadRelationship are also worth the same treatment(?)

with regards,
--

Lachlan Deck



_______________________________________________
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