-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3939057
By: nobody
Hi all,
I have a little problem with Hibernate and the events:
I tried to add an event to a Paginal component.
my event use a DAO (the Dao use the HibernateUtil to have a session).
When the event is sent to the engine,
I have a ZK message : Session is closed
I have tried the OpenSessionInViewListener and the HibernateSessionContextListener without any success.
any help?
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3939240
By: henrichen
When you see something like Session is "closed", it is generally because a "detached"
DAO is not "reattached" to the current hibernate session before calling database accessing methods. The method then use the previous "attached" hibernate session that is already closed in previous "request" and thus throw the exception.
call
session.lock( youDAO, LockMode.NONE);
to "reattach" the DAO to "current" hibernate session before calling those database accessing method should solve the issue.
And this is not related to ZK's event model. It is about the "detached" DAO is not properly "reattached". The same issue will happen on non-ZK environment.
/henri
Asked: 2006-09-29 13:55:27 +0800
Seen: 210 times
Last updated: Sep 29 '06