prefetch can set state to modified
----------------------------------
Key: CAY-788
URL: https://issues.apache.org/cayenne/browse/CAY-788
Project: Cayenne
Issue Type: Bug
Components: Cayenne Core Library
Affects Versions: 2.0 [STABLE]
Environment: cayenne-2.0.2, java 5, a mac, PostgreSQL and Derby
Reporter: Tore Halset
I have a situation where adding a prefetch to a simple select query set the persistence state to "modified" even though they are not modified. Here are the stacktrace to where the state are set to modified:
at no.ecc.gds.data.GdsCellUpdate.setPersistenceState(GdsCellUpdate.java:47)
at org.apache.cayenne.access.ObjectStore.registerDiff(ObjectStore.java:167)
at org.apache.cayenne.access.DataContext.propertyChanged(DataContext.java:1838)
at org.apache.cayenne.CayenneDataObject.writeProperty(CayenneDataObject.java:227)
at org.apache.cayenne.access.PrefetchProcessorNode.linkToParent(PrefetchProcessorNode.java:90)
at org.apache.cayenne.access.ObjectTreeResolver$DisjointProcessor.startDisjointPrefetch(ObjectTreeResolver.java:359)
at org.apache.cayenne.query.PrefetchTreeNode.traverse(PrefetchTreeNode.java:167)
at org.apache.cayenne.query.PrefetchTreeNode.traverse(PrefetchTreeNode.java:180)
at org.apache.cayenne.access.ObjectTreeResolver.resolveObjectTree(ObjectTreeResolver.java:87)
at org.apache.cayenne.access.ObjectTreeResolver.synchronizedObjectsFromDataRows(ObjectTreeResolver.java:69)
at org.apache.cayenne.access.DataDomainQueryAction.interceptObjectConversion(DataDomainQueryAction.java:328)
at org.apache.cayenne.access.DataDomainQueryAction.execute(DataDomainQueryAction.java:116)
at org.apache.cayenne.access.DataDomain.onQuery(DataDomain.java:746)
at org.apache.cayenne.util.ObjectContextQueryAction.runQuery(ObjectContextQueryAction.java:217)
at org.apache.cayenne.access.DataContextQueryAction.execute(DataContextQueryAction.java:54)
at org.apache.cayenne.access.DataContext.onQuery(DataContext.java:1387)
at org.apache.cayenne.access.DataContext.performQuery(DataContext.java:1376)
Here are the query:
DataContext ctxt = createDataContext();
SelectQuery query = new SelectQuery(A.class);
query.addPrefetch(A.B_PROPERTY);
List daos = ctxt.performQuery(query);
The relationship is a one-to-one and the primary key are compond of one String and 3 ints.
-- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
This archive was generated by hypermail 2.0.0 : Tue May 08 2007 - 05:38:21 EDT