0

Can't Open a modal : Stateless Session

asked 2017-07-03 13:44:55 +0800

DevOps gravatar image DevOps
1

updated 2017-07-03 13:53:27 +0800

I'm trying to load some huge data from the database in a "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

delete flag offensive retag edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2017-07-07 04:40:15 +0800

hawk gravatar image hawk
3250 1 5
http://hawkphoenix.blogsp... ZK Team

Regarding the error: java.lang.NoClassDefFoundError: org/zkoss/mesg/MCommon

it's obvious that zcommon.jar is missing in your classpath, please check.

link publish delete flag offensive edit
0

answered 2017-07-07 04:42:11 +0800

hawk gravatar image hawk
3250 1 5
http://hawkphoenix.blogsp... ZK Team

ZK stores Desktop and Page in HttpSession (not Hibernate StatelessSession), you need to find out why a session is destroyed. It's usually not related to ZK.

link publish delete flag offensive edit
Your answer
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:44:55 +0800

Seen: 17 times

Last updated: Jul 07 '17

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