cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bryan Lewis (JIRA)" <>
Subject [jira] Commented: (CAY-1009) Bogus runtime relationships can mess up commit.
Date Thu, 16 Jul 2009 20:43:14 GMT


Bryan Lewis commented on CAY-1009:

I can verify that this bug arose for us too.  We have a source entity with two to-one relationships
to target entities that both inherit from the same table.  When we try to insert a new instance
of the source entity, we get:

    Error resolving to-one fault. More than one object found. Source Id: 
    <ObjectId:Claim, CLAIM_ID=8891>, relationship: runtimeRelationship0  

Cayenne found two objects in the table and thought it was an error.

I'm not sure why a runtimeRelationship was involved (and debugging what entities it pointed
to was a bit tedious... adding my vote for a different naming), but anyway...  applying Kevin's
patch fixed it.  Thanks!

> Bogus runtime relationships can mess up commit.
> -----------------------------------------------
>                 Key: CAY-1009
>                 URL:
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Cayenne Core Library
>    Affects Versions: 3.0
>            Reporter: Kevin Menard
>            Assignee: Andrus Adamchik
>         Attachments: CAY-1009.patch
> I'm still the process of investigating this one, so more details to come.  Basically
what I'm seeing is that if two ObjRels map to the same DbRel somehow and only one is mapped
explicitly, the runtime one can fail validation while the specified one passes.  I'm observing
this in a relationship that involves inheritance.  It looks like I've explicitly mapped an
ObjRel for the subclass type and Cayenne is creating one for the base class.  The DbAttr is
marked as required.  Since I never specify a value in the runtime relationship, since it's
not mapped or useful to me, validation fails.  If I don't mark the attribute as mandatory,
everything commits just fine.  So, I suspect Cayenne resolves the conflict somewhere down
the line.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message