Re: Nested Editing Contexts
Re: Nested Editing Contexts
- Subject: Re: Nested Editing Contexts
- From: Mike Schrag <email@hidden>
- Date: Wed, 30 May 2007 18:38:15 -0400
willChange calls willRead (i just happened to check this) ... I THINK
willReadRelationship is probably the same? Not sure about that offhand.
On May 30, 2007, at 6:32 PM, Lachlan Deck wrote:
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@hidden)
Help/Unsubscribe/Update your Subscription:
40mdimension.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden