cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcin Skladaniec <>
Subject problem with ROP query performance
Date Fri, 21 Oct 2011 06:22:01 GMT

There is a discrepancy in behaviour of performQuery between ROP and 
non-ROP setup.

lets consider this simple code:

         DataContext newContext = ...

         Artist artist = newContext.newObject(Artist.class);

         Painting painting = newContext.newObject(Painting.class);

PersistenceState.MODIFIED); // this is true

         SelectQuery sq = new SelectQuery(Painting.class, 
ExpressionFactory.matchExp(Painting.ARTIST_PROPERTY, artist));


I have added some logging to the performQuery() to check what happens. 
This is what I see in ROP setup:

DEBUG - select query for Painting with qualifier: artist = 
<ObjectId:Artist, id=200>
DEBUG - RelationshipQuery:paintings for: <ObjectId:Artist, id=200>

Seems straightforward, select query is executed... but then cayenne 
faults the Artist object and its relationships. This would be ok, but 
the Artist object is already in the context, no trip to the databse 

Same code in non-ROP setup does not behave teh same - the 
RelatioshipQuery is not executed (unless artist.getPaintings() is called 

For us this Relationship Query is a big big performance problem.
Is that a bug in ROP? Is there a way to prevent faulting of the relatioship?

With regards

View raw message