-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
I read the smalltalk Hibernate + ZK.
If I understand it right, the Spring based OpenSessionInViewFilter does not function because ZK triggers multiple requests for a page. I receive the LazyInitializationException while creating a simple window.
You have a paralell solution that works without Spring. Is there a way to use org.zkoss.zkplus.hibernate.OpenSessionInViewListener based on a Spring context?
My configuration is similar to those in this thread.
What would be the best practice in this case?
Thanks,
Gabor
Hi Gabor,
Please refer to
http://www.zkoss.org/javadoc/3.0.6/zkplus/org/zkoss/zkplus/spring/SpringTransactionSynchronizationListener.html
/robbie
Please, I´m trying to do a "Lazy" call with Hibernate + Spring and I´m getting LazyInitializatonExceptio. I´ve done all configurations in zk.xml (ThreadLocalListenter), web.xml (Spring OpenSessionInViewFilter), but I´m still getting this Exception. Can you help me? Thanks.
Problem solved. If you try to get some lazy collection, you need to reload your bean from your ORM tool (Hibernate) before get the lazy collection. Don´t forget to configure your OpenSessionInView Filter and syncronize your threads. Thanks.
Hello. Am having a similar and very funny and boring problem. Its taking me days to solve it.
Am using openSessionInViewFilter and it seems to be workin when i access a specific zul page, typing its url directly in
the browser(the hibernate session is found open and I am able to load the lazy collections).
But when i call the same page as an inner page from an INCLUDE component (the app url doesnt change, only the src of the include component
does), i find the session closed and i get the famous exception: COllection is not associated with any session :-).
Since the main page which contains the include component was already loaded, the hibernate session is supposed to
be closed (thats how i tried to interpret this error).
Is there anyway to force the session to open when using the include component?
Thanks and Mayday!
please follow jrdalpra's suggestion to reload the bean from ORM tool again in your included page.
or the session would be closed in last request.
/robbie
Asked: 2008-07-10 12:21:47 +0800
Seen: 693 times
Last updated: Apr 06 '09