Re: decoding an EO from NSXMLInputStream
Re: decoding an EO from NSXMLInputStream
- Subject: Re: decoding an EO from NSXMLInputStream
- From: Jean-François Veillette <email@hidden>
- Date: Mon, 4 Apr 2005 14:48:57 -0400
Thanks Chuck !!!
one more excerpt (for the archive) :
<excerpt>
setSubstitutionEditingContext(defaultEditingContext());
Object results = myObjectInputStream.readObject();
setSubstitutionEditingContext(null);
</excerpt>
and
<excerpt>
If you intend to have several threads potentially Serializing
enterprise objects simultaneously, you should create a separate lock
object, such as an NSLock, to manage potential contention.
</excerpt>
- jfv
Le 05-04-04, à 14:28, Chuck Hill a écrit :
Go to the JavaDocs for EOEditingContext, then look for the link "Using
EOEditingContext to Archive Custom Objects in Web Objects Framework"
that is just above see also. On my machine it is
file:///Developer/Documentation/WebObjects/Reference/API/com/
webobjects/eocontrol/concepts/
EOEditingContextConcepts.html#ARCHIVINGOBJECTS
An excerpt:
"It also has the methods setSubstitutionEditingContext and
substitutionEditingContext. These control which EOEditingContext
deserialized enterprise objects are placed into. Unless you have set
an explicit substitution context, the EOEnterpriseObjects will be
deserialized into the EOEditingContext in the serialized stream (i.e.
a transitory EOEditingContext for which you do not have a reference)."
Chuck
On Apr 4, 2005, at 8:02 AM, Jean-François Veillette wrote:
I use
ByteArrayInputStream istream = new
ByteArrayInputStream(e.getBytes("UTF-8"));
NSXMLInputStream p = new NSXMLInputStream(istream);
NSDictionary ui = (NSDictionary)p.readObject();
p.close();
To get back a dictionary in which I have, among other values, an
EOQualifiers qualifying based an EnterpriseObject.
I can get back my eo and reapply the qualifier to a new fetch spec,
but I wonder why and how ???
When NSXMLInputStream is reading an EO, in which eoEditingContext is
it putting it into ?
I'm in early development of this system, I did not tested it
extensively, but to my surprise it just work so far. I thought I
would have to make some more management about deserializing an eo,
give an eoeditingcontext to deserialize into, or anything like that.
I'm afraid I'll hit a wall sooner or later, any experience with
deserializing an eo from a xml stream ?
Anything I should know before it's too late ?
thanks !
- jfv
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
village.net
This email sent to email@hidden
--
Practical WebObjects - a book for intermediate WebObjects developers
who want to increase their overall knowledge of WebObjects, or those
who are trying to solve specific application development problems.
http://www.global-village.net/products/practical_webobjects
______________________________________________________________________
Post your free ad now! http://personals.yahoo.ca
_______________________________________________
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