Re: Strange localInstanceOfObject behaviour...
Re: Strange localInstanceOfObject behaviour...
- Subject: Re: Strange localInstanceOfObject behaviour...
- From: Chuck Hill <email@hidden>
- Date: Wed, 31 May 2006 13:31:32 -0700
Has the object been saved? You can only use localInstance on a saved
EO.
Chuck
On May 31, 2006, at 1:09 PM, Kieran Kelleher wrote:
I think I am losing my mind....
I have a newly created object in an editing context and I am making
a local instance of it in a another editing context ..... however
localInstanceOfObject always returns null!! What gives?!
<snip>
public void setJob( CTJob job ) {
if ( log.isDebugEnabled() ) log.debug("Setting job from "
+ ( _job == null ?
"null" : _job.toLongString() )
+ " to "
+ ( job == null ?
"null" : job.toLongString() ) );
if ( log.isDebugEnabled() ) log.debug("job.editingContext()
= " + WKStringUtilities.toString( job.editingContext() ) );
if ( !job.editingContext().equals( defaultEditingContext
() ) ) {
defaultEditingContext().lock();
try {
if ( log.isDebugEnabled() ) log.debug
("defaultEditingContext() = " + WKStringUtilities.toString
( defaultEditingContext() ) );
if ( log.isDebugEnabled() ) log.debug("job = " +
( job == null ? "null" : job.toLongString() ) );
_job = (CTJob)EOUtilities.localInstanceOfObject
( defaultEditingContext(), job );
if ( log.isDebugEnabled() ) log.debug("Made local
copy of job = " + ( _job == null ? "null" : _job.toLongString() ) );
} finally {
defaultEditingContext().unlock();
}
} else {
_job = job;
}
}
</snip>
gives log output like this:
<snip>
165677 DEBUG [PdX752d1r3lPfb0FXMB9f0kieranWorkerThread5]
(JobMessageRelateAndSaveLRTask, setJob, 24) -
Setting job from null to {values = {productionDispatchDate =
2006-06-01 04:00:00 Etc/GMT; inheritanceType = 10; product =
"<CTProduct 356844 _EOIntegralKeyGlobalID[CTProduct
(java.lang.Integer)1]>"; shipDate = 2006-06-03 04:00:00 Etc/GMT;
messages = (); descriptor = "asasdasdasda"; workflowState =
"setup"; jobCode = <com.webobjects.foundation.NSKeyValueCoding
$Null>; recAddUser = <com.webobjects.foundation.NSKeyValueCoding
$Null>; recModUser = <com.webobjects.foundation.NSKeyValueCoding
$Null>; recAddTime = <com.webobjects.foundation.NSKeyValueCoding
$Null>; recModTime = <com.webobjects.foundation.NSKeyValueCoding
$Null>; }; this = "<CTSmartMixJob 5ee1b2 <EOTemporaryGlobalID: 0 0
-64 -88 1 6 0 0 -53 72 1 0 0 0 1 11 -116 8 -112 61 41 -14 -31
105>>"; }
165680 DEBUG [PdX752d1r3lPfb0FXMB9f0kieranWorkerThread5]
(JobMessageRelateAndSaveLRTask, setJob, 29) -
job.editingContext() = WKEditingContext@c9ab52
165682 DEBUG [PdX752d1r3lPfb0FXMB9f0kieranWorkerThread5]
(JobMessageRelateAndSaveLRTask, setJob, 34) -
defaultEditingContext() = WKEditingContext@6bc09d
165686 DEBUG [PdX752d1r3lPfb0FXMB9f0kieranWorkerThread5]
(JobMessageRelateAndSaveLRTask, setJob, 35) -
job = {values = {productionDispatchDate = 2006-06-01 04:00:00 Etc/
GMT; inheritanceType = 10; product = "<CTProduct 356844
_EOIntegralKeyGlobalID[CTProduct (java.lang.Integer)1]>"; shipDate
= 2006-06-03 04:00:00 Etc/GMT; messages = (); descriptor =
"asasdasdasda"; workflowState = "setup"; jobCode =
<com.webobjects.foundation.NSKeyValueCoding$Null>; recAddUser =
<com.webobjects.foundation.NSKeyValueCoding$Null>; recModUser =
<com.webobjects.foundation.NSKeyValueCoding$Null>; recAddTime =
<com.webobjects.foundation.NSKeyValueCoding$Null>; recModTime =
<com.webobjects.foundation.NSKeyValueCoding$Null>; }; this =
"<CTSmartMixJob 5ee1b2 <EOTemporaryGlobalID: 0 0 -64 -88 1 6 0 0
-53 72 1 0 0 0 1 11 -116 8 -112 61 41 -14 -31 105>>"; }
165687 DEBUG [PdX752d1r3lPfb0FXMB9f0kieranWorkerThread5]
(JobMessageRelateAndSaveLRTask, setJob, 39) -
Made local copy of job = null
</snip>
I make local instances of new objects in other places with no
issues ..... usually 99.9% of problems are of my own doing, but
this one is baffling me. Is this a bug introduced in 5.3.1 when
they fixed radar 4240473?
-Kieran
________________________________________________________________
Blog: http://webobjects.webhop.org/
Dev Config = OS X 10.4.5 i686-C.Duo / Java 1.4.2_09 / WO 5.3.1 &
P. Wonder / XCode v2.2.1 / MySQL 4.1.18-std / Connector-J 3.0.17
Deploy Config = OS X 10.3.9 Server G4-PPC / Java 1.4.2_09 / WO
5.2.3 / MySQL 4.0.26 / Connector-J 3.0.17
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40global-village.net
This email sent to email@hidden
--
Coming in 2006 - an introduction to web applications using WebObjects
and Xcode http://www.global-village.net/wointro
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems. http://www.global-village.net/products/practical_webobjects
_______________________________________________
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