cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emanuele Maiarelli <maiarelli.emanu...@gmail.com>
Subject A small update
Date Thu, 04 Oct 2012 23:02:10 GMT
I tried to figureout a workaround to objects in hollow state.

 Object value = toCall.invoke(p); // <- p is the getToComuni method
            if (value instanceof Persistent)
            {
                Persistent pr=(Persistent)value;

                if (pr.getPersistenceState()==PersistenceState.HOLLOW)
                {
                    c.add(value);
                    value=DataObjectUtils.objectForPK(Factory.getContext(),
pr.getObjectId());

                }


            }

the object after calling "DataObjectUtils.objectForPK(" comes i the correct
"Commited" state, but however fetching all "comuni" objects after reflection
throw the same exception, when the query is paginated.

That's the stack trace:

org.apache.cayenne.CayenneRuntimeException: [v.3.0.2 Jun 11 2011 09:26:09]
Can't find id for {<ObjectId:Comuni, comuni_pk=4615>; committed;
[toProvince=>?; anagraficheArray=>(..); comuniCap=>55049;
comuniComIstat=>33; comuniCfPrefix=>L833; anagraficheArraySl=>(..);
comuniDesc=>PROVA]}
    at
org.apache.cayenne.access.IncrementalFaultList$IncrementalListHelper.updateWithResolvedObjectInRange(IncrementalFaultList.java:701)
    at
org.apache.cayenne.access.IncrementalFaultList.resolveInterval(IncrementalFaultList.java:306)
    at
org.apache.cayenne.access.IncrementalFaultList.get(IncrementalFaultList.java:550)
    at
org.apache.cayenne.access.IncrementalFaultList$1.next(IncrementalFaultList.java:467)

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message