Hi i have an error:
Quote:
org.hibernate.loader.MultipleBagFetchException: cannot simultaneously fetch multiple bags
at org.hibernate.loader.BasicLoader.postInstantiate(BasicLoader.java:94)
at org.hibernate.loader.criteria.CriteriaLoader.<init>(CriteriaLoader.java:106)
at org.hibernate.impl.SessionImpl.scroll(SessionImpl.java:1670)
at org.hibernate.impl.CriteriaImpl.scroll(CriteriaImpl.java:361)
My code:
Code:
//open session and trans
Criteria c = //creating a criteria
c.createAlias( //creating a few aliases
c.setResultTransformer(Criteria.ALIAS_TO_ENTITY_MAP);
ScrollableResults scroll = c.setCacheMode(CacheMode.IGNORE).scroll(ScrollMode.FORWARD_ONLY);
int count = 0;
while(scroll.next()) {
Object[] objs = guidesScroll.get();
if(objs.length > 0 && objs[0] != null) ((A)objs[0]).setDeleted(Boolean.TRUE);
if(objs.length > 1 && objs[1] != null) ((B)objs[1]).setDeleted(Boolean.TRUE);
f(++count % 20 == 0) {
s.flush();
s.clear();
}
}
//
//close trans
what i doing wrong?