• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Digging up a Session object from an EOGenericRecord
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Digging up a Session object from an EOGenericRecord


  • Subject: Re: Digging up a Session object from an EOGenericRecord
  • From: Riccardo De Menna <email@hidden>
  • Date: Sat, 7 Mar 2009 17:09:42 +0100

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      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Digging up a Session object from an EOGenericRecord
      • From: Jérémy DE ROYER <email@hidden>
References: 
 >Digging up a Session object from an EOGenericRecord (From: Riccardo De Menna <email@hidden>)
 >Re: Digging up a Session object from an EOGenericRecord (From: Jérémy DE ROYER <email@hidden>)

  • Prev by Date: Re: Digging up a Session object from an EOGenericRecord
  • Next by Date: Re: Digging up a Session object from an EOGenericRecord
  • Previous by thread: Re: Digging up a Session object from an EOGenericRecord
  • Next by thread: Re: Digging up a Session object from an EOGenericRecord
  • Index(es):
    • Date
    • Thread