-
FEATURED COMPONENTS
First time here? Check out the FAQ!
1 | initial version | |
I'm trying to load some huge data from the database in a "AfterCompse" method of a modal, but the modal keeps charging and doesn't show with this error * AVERTISSEMENT [org.zkoss] Page [Page eSEQ] was destroyed because desktop was destroyed.It is usually caused by invalidating the native session directly. If it is required, please set Attributes.RENEWNATIVE_SESSION first.*
Also : java.lang.NoClassDefFoundError: org/zkoss/mesg/MCommon
I'm loading the data using this method :
@SuppressWarnings({ "unchecked" })
@Override
@Transactional
public List<T> findAll() {
StatelessSession session = ((Session) entityManager.getDelegate())
.getSessionFactory().openStatelessSession();
org.hibernate.Query query = session.createQuery("SELECT t FROM table t ORDER BY t.id");
query.setReadOnly(true);
query.setFetchSize(Integer.valueOf(1000));
query.setLockMode("z", LockMode.NONE);
ScrollableResults resultList = query.scroll(ScrollMode.FORWARD_ONLY);
entityManager.flush();
List<T> result = new ArrayList<T>();
while (resultList.next()) {
result.add((T) resultList.get()[0]);
}
session.close();
return result;
} Any help will be appreciated, thanks
2 | No.2 Revision |
I'm trying to load some huge data from the database in a "AfterCompse" "initSetup" method of a modal, but the modal keeps charging and doesn't show with this error * AVERTISSEMENT [org.zkoss] Page [Page eSEQ] was destroyed because desktop was destroyed.It is usually caused by invalidating the native session directly. If it is required, please set Attributes.RENEWNATIVE_SESSION first.*
Also : java.lang.NoClassDefFoundError: org/zkoss/mesg/MCommon
I'm loading the data using this method :
@SuppressWarnings({ "unchecked" })
@Override
@Transactional
public List<T> findAll() {
StatelessSession session = ((Session) entityManager.getDelegate())
.getSessionFactory().openStatelessSession();
org.hibernate.Query query = session.createQuery("SELECT t FROM table t ORDER BY t.id");
query.setReadOnly(true);
query.setFetchSize(Integer.valueOf(1000));
query.setLockMode("z", LockMode.NONE);
ScrollableResults resultList = query.scroll(ScrollMode.FORWARD_ONLY);
entityManager.flush();
List<T> result = new ArrayList<T>();
while (resultList.next()) {
result.add((T) resultList.get()[0]);
}
session.close();
return result;
} Any help will be appreciated, thanks