0

zk+hibernate+event+paginal bug ?

asked 2006-09-29 13:55:27 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


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?



delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2006-09-29 14:56:12 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


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



link publish delete flag offensive edit
Your reply
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

RSS

Stats

Asked: 2006-09-29 13:55:27 +0800

Seen: 210 times

Last updated: Sep 29 '06

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