Hmmm, I don't see anything specific sticking out. What I do know so far is
that your error is because you can't serialize org.datanucleus.sco.backed.List
which happens when the collection doesn't get detached from the datastore.
You can pause/break on the the variable before return rpc transport and see
if it was detached by looking at the var type. On a successful detachment it
will be a java.util.List collection and not org.datanucleus.sco.backed.List.
Sorry I might be speaking to the choir. :)
Here is how I setup my owned collections:
@Persistent(defaultFetchGroup = "true", dependentElement = "true")
private LinkedHashSet<CourseJdo> courses;
The iteration or query you have above doesn't look right to me. I'm not sure
if your detaching the child or parent.
Here is one of my queries in which I use detach.
private LearningPlanData[] queryData(LearningPlanDataFilter filter) {
String qfilter = null;
// filter a batch of ids
List<Key> keysList = null;
if (filter.getUseIds() == true) {
keysList = getFilterForIds(filter);
if (keysList != null) {
qfilter = ":keys.contains(key)";
}
if (keysList == null || keysList.size() == 0) {
return null;
}
}
ArrayList<LearningPlanData> a = new ArrayList<LearningPlanData>();
PersistenceManager pm = sp.getPersistenceManager();
try {
Query q = pm.newQuery("select from " + LearningPlanJdo.class.getName());
if (qfilter != null) {
q.setFilter(qfilter);
}
q.setRange(filter.getRangeStart(), filter.getRangeFinish());
List<LearningPlanJdo> ids = null;
if (filter.getUseIds() == true && keysList != null) {
ids = (List<LearningPlanJdo>) q.execute(keysList);
} else {
ids = (List<LearningPlanJdo>) q.execute();
}
Iterator<LearningPlanJdo> itr = ids.iterator();
while (itr.hasNext()) {
LearningPlanJdo j = itr.next();
if (j != null) {
j.getData();
LearningPlanJdo detatched = pm.detachCopy(j);
a.add(detatched.getData());
}
}
q.closeAll();
} catch (Exception e) {
e.printStackTrace();
log.log(Level.SEVERE, "", e);
} finally {
pm.close();
}
if (a.size() == 0) {
return null;
}
LearningPlanData[] r = new LearningPlanData[a.size()];
a.toArray(r);
return r;
}
Hope that helps,
Brandon Donnelson
http://gwt-examples.googlecode.com
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-web-toolkit/-/kAP81TuHP58J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.