Re: ERXEC question
Re: ERXEC question
- Subject: Re: ERXEC question
- From: Dev WO <email@hidden>
- Date: Mon, 12 Aug 2013 21:38:19 +0200
I haven't check the "normal" EC management, but I'm pretty confident that if it's not the default behavior in Wonder it's because it could be "unsafe".
Xavier
On 12 août 2013, at 21:31, Lars Sonchocky-Helldorf <email@hidden> wrote:
> So you're suggesting that the behavior we are seeing here is specific to ERXECs and not to "normal" ECs?
>
> cheers,
>
> Lars
>
> Am 12.08.2013 um 21:26 schrieb Dev WO <email@hidden>:
>
>> Hi Lars,
>>
>> You could overwrite (or create another) method "fetchAllPaymentCustomers" to apply:
>> setIncludeEditingContextChanges(true)
>>
>> I recall a discussion about this stating it was "on purpose" that Wonder doesn't do it by default. So you have to manually deal with it that way you actually know you are manipulating objects that may not all already be committed to the datastore.
>>
>> Xavier
>>
>>
>> On 12 août 2013, at 19:37, Lars Sonchocky-Helldorf <email@hidden> wrote:
>>
>>> Hi list,
>>>
>>> we are creating a new EO and insert it into an ERXEC like this:
>>>
>>> public static PaymentCustomer createPaymentCustomer(EOEditingContext editingContext, Integer creditScore, String fullQualifiedClassName, Integer ingameId)
>>> {
>>> PaymentCustomer eo = (PaymentCustomer) EOUtilities.createAndInsertInstance(editingContext, _PaymentCustomer.ENTITY_NAME);
>>> eo.setCreditScore(creditScore);
>>> eo.setFullQualifiedClassName(fullQualifiedClassName);
>>> eo.setIngameId(ingameId);
>>> return eo;
>>> }
>>>
>>> later we want to access this EO like this (before calling savingChanges of the ERXEC, the edtingContext is the same):
>>>
>>> NSArray<PaymentCustomer> paymentCustomerTest = PaymentCustomer.fetchAllPaymentCustomers(this.editingContext());
>>>
>>> this results in an empty NSArray.
>>>
>>>
>>> Debugging this code revealed that there's nothing in _insertedObjects of this ERXEC but in _unprocessedInserts. When calling processRecentChanges() of this ERXEC before "fetching" everything works like expected.
>>>
>>>
>>> My Question now is: why is this call to processRecentChanges() necessary at all and is it the right solution for our problem? http://comments.gmane.org/gmane.comp.web.webobjects.devel/24056 seems to suggest otherwise. So what would be "the right thing to do™"?
>>>
>>>
>>> best regards,
>>>
>>> Lars
>>> _______________________________________________
>>> 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
>>
>
>
>
_______________________________________________
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