Re: Digging up a Session object from an EOGenericRecord
Re: Digging up a Session object from an EOGenericRecord
- Subject: Re: Digging up a Session object from an EOGenericRecord
- From: Jérémy DE ROYER <email@hidden>
- Date: Sat, 7 Mar 2009 17:22:23 +0100
We use it without problems since 2 years
But we neither use D2W nor Wonder (except for Ajax) nor nested
context (as far as I know).
We only use adaptated Chuck's ValidatingEditingContext and
EOStateTransition that rocks.
Jérémy
P.S. : many thanks to Chuck's book.
Le 7 mars 09 à 17:09, Riccardo De Menna a écrit :
Ok... as suggested by Jérémy I injected my own editing context
using wonder's factory.
I now have a nice place to store my session object directly into
the context.
Question 1: Can you foresee any problems in my editing context
holding a reference to the session? Could it cause garbage
collection delays or stuff like that?
... let's go on I have another question coming :)
Now I placed all this in my code and I still don't get the desired
result. That's because my objects are being fumbled by Wonder D2W
pages. And as I find out, at the time of pressing the "edit" or
"inspect" button, wonder makes his own context and pulls a local
instance of the edited object in it.
So hey... if the guys wrote it like that there must be a good
reason. The following comment from Anjo made me laugh:
//CHECKME ak: I don't remember why we would use a local instance
when we just want to inspect...
Anyway... skipping over the Inspect stuff, when it comes to the
Edit, scrolling through the code I found that there was a binding I
could stick in my rules file to force wonder to at least nest his
new context into mine. So I added "useNestedEditingContext" and
"useExistingEditingContext" in my rules and changed my code to
climb the hierarchy of the parentObjectStore() and it now works.
Question 2: What are the implications of having turned on the
nested contexts? Am I going to face some weird undetectable issue
in the near future that will make me regret this choice?
thx,
rdm
On 07/mar/09, at 14:04, Jérémy DE ROYER wrote:
Hi,
We do superclass the EOEditingContext according to Chuck's method
with his ValidatingEditingContext.
When créating the "new" editing context, we pass our Session.
So it's easy to get the session from a enterprise object :
this.editingContext().getSession().
public Session() {
super();
setDefaultEditingContext(new ValidatingEditingContext(this));
}
Jérémy
Jérémy DE ROYER, tél 02 38 43 45 86
--
INGENCYS, Conseil & Ingénierie en Systèmes d'Information
- e-Commerce & Internet,
- Cartographie & Géolocalisation
- CRM & Gestion de la Relation Client
- Processus, Documents & Qualité
ORLEANS - CHARTRES - LE MANS
http://www.ingencys.net/
_______________________________________________
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