O'Reilly logo

ZK Developer's Guide by Markus Stauble, Hans-Jurgen Schumacher, Jurgen Schumacher

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hibernate

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> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required