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
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to