Well, Hibernate has really nothing to do with a view layer so why are we talking here about this issue?
Normally, Hibernate is used along with Spring to take care of the database transactions. In the Spring sample the section above in we have also shown the integration of Hibernate to do the mapping and DAO handling. However, unfortunately there is a downer. Hibernate has a different session management. Unlike the ZK multi-threaded environment, Hibernate handles all data accessing operations in one session. To solve this problem the creators of ZK developed their own ZK listener for Hibernate.
This listener has to be configured in the zk.xml:
<listener> <description>Hibernate thread session context handler</description> <listener-class> ...