cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrus Adamchik (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (CAY-1714) ROP: Cayenne tries to build a query for non committed object when using more than 2 nested contexts
Date Tue, 18 Dec 2012 06:52:15 GMT

     [ https://issues.apache.org/jira/browse/CAY-1714?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Andrus Adamchik closed CAY-1714.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 3.2M1

Thanks Dima, Ilya for investigating and fixing this issue.
                
> ROP: Cayenne tries to build a query for non committed object when using more than 2 nested
contexts
> ---------------------------------------------------------------------------------------------------
>
>                 Key: CAY-1714
>                 URL: https://issues.apache.org/jira/browse/CAY-1714
>             Project: Cayenne
>          Issue Type: Bug
>          Components: ROP
>    Affects Versions: 3.1M3
>            Reporter: Dzmitry Kazimirchyk
>             Fix For: 3.1B2, 3.2M1
>
>         Attachments: CAY-1714_ROP__Cayenne_tries_to_build_a_query_for_non_committed_object_when_using_more_than.patch,
cay1714-unit-test.patch
>
>
> Code describing the problem:
>         CayenneContext context = cayenneService.getContext();  
>         Artist a = context.newObject(Artist.class);
>         a.setArtistName("a");
>         ObjectContext child = context.createChildContext();        
>         Painting p = child.newObject(Painting.class);
>         p.setPaintingTitle("p");
>         p.setToArtist(child.localObject(a));
>         
>         child.commitChangesToParent();
>         
>         p.getToGallery(); // this will throw an exception
> On the last line following exception will be thrown:
> org.apache.cayenne.CayenneRuntimeException: [v.3.1M4-SNAPSHOT Jun 15 2012 06:55:01] Can't
build a query for relationship 'gallery' for temporary id: <ObjectId:Painting, TEMP:000001CA37BA0001>
> 	at org.apache.cayenne.query.RelationshipQuery.createReplacementQuery(RelationshipQuery.java:113)
> 	at org.apache.cayenne.query.IndirectQuery.getReplacementQuery(IndirectQuery.java:103)
> 	at org.apache.cayenne.query.IndirectQuery.route(IndirectQuery.java:86)
> 	at org.apache.cayenne.access.DataDomainQueryAction.runQuery(DataDomainQueryAction.java:424)
> ....................
> Persistence state of artist and painting objects by that moment will be COMMITTED.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message