0

Can't Open a modal : Stateless Session

asked 2017-07-03 13:43:04 +0800

DevOps gravatar image DevOps
1

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

delete flag offensive retag edit
Be the first one to answer this question!
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2017-07-03 13:43:04 +0800

Seen: 6 times

Last updated: Jul 03 '17

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More