I can also get it to throw this error:

Caused by: org.apache.cayenne.FaultFailureException: [v.4.1.M1-SNAPSHOT Jul
19 2017 19:49:41] Error resolving fault, no matching row exists in the
database for ObjectId: <ObjectId:OrderDetailSale, order_line_number=2,
order_number=55663878>

at org.apache.cayenne.BaseContext.prepareForAccess(BaseContext.java:365)

at org.apache.cayenne.CayenneDataObject.readProperty(
CayenneDataObject.java:174)

at
com.smarthealth.businesslogic.production.auto._OrderDetailSale.getPersonalizationDiscPercent(
_OrderDetailSale.java:316)

at
com.smarthealth.businesslogic.production.auto._OrderDetailSale.personalizationDiscPercent(
_OrderDetailSale.java:319)

at
com.smarthealth.businesslogic.production.BillingOrderDetailSales.personalizationDiscountAmount(
BillingOrderDetailSales.java:26)

at
com.smarthealth.businesslogic.production.BillingOrderDetailSales.extendedPrice(
BillingOrderDetailSales.java:30)

Where the OrderDetailSale object in question is new on an OrderHeader which
isn’t new.

-Lon

On Wed, Jul 19, 2017 at 1:23 PM, Lon Varscsak <[email protected]>
wrote:

> Okay, I’ll see if I can work up a test case.  Note:  This only happens if
> the objects in question are new objects (not in the db).  When it tries to
> find the “id” in DataRowUtils it comes back with nothing, so then it nulls
> the reverse relationship out (even though at that point the reverse
> relationship is in the child and has all of it’s values).
>
> -Lon
>
> On Wed, Jul 19, 2017 at 12:34 AM, Nikita Timofeev <
> [email protected]> wrote:
>
>> Hi Lon,
>>
>> I've tried to dig dipper into your case, and I can't repeat described
>> behavior, all I see is that toOne
>> relationship in object that moved to other context is faulted and
>> resolved on next access,
>> and no reverse relationships are affected. And that I assume is
>> expected behavior.
>>
>> And even more I can't figure out case when line 194 in DataRowUtils can
>> be hit.
>> May be you can provide some simple test case?
>>
>> On Mon, Jul 17, 2017 at 9:14 PM, Lon Varscsak <[email protected]>
>> wrote:
>> > Okay, that didn’t work.
>> > https://www.dropbox.com/s/68hsculni16ucg3/Screen%20Shot%2020
>> 17-07-13%20at%2010.50.24%20AM.png?dl=0
>> >
>> > -Lon
>> >
>> > On Mon, Jul 17, 2017 at 11:06 AM, Lon Varscsak <[email protected]>
>> > wrote:
>> >
>> >> Try this:
>> >>
>> >> http://gofile.me/34oeM/YdPU7U4j1
>> >>
>> >> On Mon, Jul 17, 2017 at 10:08 AM, Andrus Adamchik <
>> [email protected]>
>> >> wrote:
>> >>
>> >>> Unfortunately the mailing list strips attachments. Could you post the
>> >>> image elsewhere, like GoogleDrive or Dropbox?
>> >>>
>> >>> Andrus
>> >>>
>> >>> > On Jul 13, 2017, at 8:51 PM, Lon Varscsak <[email protected]>
>> >>> wrote:
>> >>> >
>> >>> > I found the line that’s nulling it out…I just don’t understand at
>> this
>> >>> deep level what’s going on.  Here’s the strack trace:
>> >>> >
>> >>> > On Thu, Jul 13, 2017 at 10:43 AM, Lon Varscsak <
>> [email protected]>
>> >>> wrote:
>> >>> > I have an object (that’s new) in ObjectContextA that has a
>> relationship
>> >>> to another new object (same OC) which also has a reverse
>> relationship.  I
>> >>> then create a child of that OC (ObjectContactB) and grab a local
>> version of
>> >>> the first object.  At that time, the relationship object (and it’s
>> reverse)
>> >>> is there and all is good in the world.
>> >>> >
>> >>> > The moment I touch the object (setting a simple property with
>> >>> writeProperty) in the relationship the reverse relationship gets
>> nulled
>> >>> out.  Any thoughts as to why this might happen?
>> >>> >
>> >>> > -Lon
>> >>> >
>> >>>
>> >>>
>> >>
>>
>>
>>
>> --
>> Best regards,
>> Nikita Timofeev
>>
>
>

Reply via email to