Re: Handling Hibernate session (LazyInitializationException)
yes - it run's smoothly together ... Am 18.09.2009 um 07:44 schrieb Michael Mosmann: Am Freitag, den 18.09.2009, 00:35 +0200 schrieb Peter Ertl: as an further improvement use salve to completely remove your headache :-) http://code.google.com/p/salve thank you.. interesting stuff.. do you have any experience in combination with hibernate? mm:) Am 17.09.2009 um 23:51 schrieb Michael Mosmann: Hi, (Solution with no Spring is preferable). Use Spring, because it will limit your headache.. Maybe this is usefull: http://www.wicket-praxis.de/blog/download/ use Link behind "Praxisbuch Wicket Beispielcode" for a maven-based project with: - Spring (open session in view filter, @SpringBean-Annotation support, Hibernate UnitTest) - Hibernate (Hibernate Annotation Support) mm:) - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Handling Hibernate session (LazyInitializationException)
Am Freitag, den 18.09.2009, 00:35 +0200 schrieb Peter Ertl: > as an further improvement use salve to completely remove your > headache :-) > >http://code.google.com/p/salve thank you.. interesting stuff.. do you have any experience in combination with hibernate? mm:) > Am 17.09.2009 um 23:51 schrieb Michael Mosmann: > > > Hi, > > > >> (Solution with no Spring is > >> preferable). > > > > Use Spring, because it will limit your headache.. > > > > Maybe this is usefull: > > http://www.wicket-praxis.de/blog/download/ > > > > use Link behind "Praxisbuch Wicket Beispielcode" for a maven-based > > project with: > > - Spring (open session in view filter, @SpringBean-Annotation support, > > Hibernate UnitTest) > > - Hibernate (Hibernate Annotation Support) > > > > mm:) > > > > > > > > - > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > > For additional commands, e-mail: users-h...@wicket.apache.org > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Handling Hibernate session (LazyInitializationException)
as an further improvement use salve to completely remove your headache :-) http://code.google.com/p/salve Am 17.09.2009 um 23:51 schrieb Michael Mosmann: Hi, (Solution with no Spring is preferable). Use Spring, because it will limit your headache.. Maybe this is usefull: http://www.wicket-praxis.de/blog/download/ use Link behind "Praxisbuch Wicket Beispielcode" for a maven-based project with: - Spring (open session in view filter, @SpringBean-Annotation support, Hibernate UnitTest) - Hibernate (Hibernate Annotation Support) mm:) - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Handling Hibernate session (LazyInitializationException)
Hi, > (Solution with no Spring is > preferable). Use Spring, because it will limit your headache.. Maybe this is usefull: http://www.wicket-praxis.de/blog/download/ use Link behind "Praxisbuch Wicket Beispielcode" for a maven-based project with: - Spring (open session in view filter, @SpringBean-Annotation support, Hibernate UnitTest) - Hibernate (Hibernate Annotation Support) mm:) - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Handling Hibernate session (LazyInitializationException)
hi, you could also use an Aspekt (e.g. with Aspekj) zu reinit all lazy proxies on the next request. The Proxy objects would be detachted and serialized throw the models. With an Aspekt you can re-attach ALL hibernate proxies, without triggering the DB. Martin Anton Komratov schrieb: > Hi, I'm using Wicket + Hibernate (without Spring). > In my application I open Hibernate *session* in WebRequestCycle.* > onBeginRequest*() and close it in WebRequestCycle.*onEndRequest*(). > > But having association (many-to-one mappings between classes) I've got > LazyInitializationException (no Session). I've just set parameter > "*lazy*"=false > in hibernate mapping file to "many-to-one" mappings. And it worked fine - > amount of data stored in memory in this case was not critical. > > Since the system is growing furhter, the method with no lazy initialization > is no more suitable. Could you, please, advise me a way to handle hibernate > session to have lazy initialization. (Solution with no Spring is > preferable). > > // Best regards, Anton > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Handling Hibernate session (LazyInitializationException)
Hi Anton The Problem you encounter is probably because you're holding on to a hibernate object between requests, thus the references are not valid anymore. Have a look at http://wicketinaction.com/2008/09/building-a-smart-entitymodel/ This works for us with hibernate. Matt Anton Komratov wrote: Hi, I'm using Wicket + Hibernate (without Spring). In my application I open Hibernate *session* in WebRequestCycle.* onBeginRequest*() and close it in WebRequestCycle.*onEndRequest*(). But having association (many-to-one mappings between classes) I've got LazyInitializationException (no Session). I've just set parameter "*lazy*"=false in hibernate mapping file to "many-to-one" mappings. And it worked fine - amount of data stored in memory in this case was not critical. Since the system is growing furhter, the method with no lazy initialization is no more suitable. Could you, please, advise me a way to handle hibernate session to have lazy initialization. (Solution with no Spring is preferable). // Best regards, Anton smime.p7s Description: S/MIME Cryptographic Signature
Handling Hibernate session (LazyInitializationException)
Hi, I'm using Wicket + Hibernate (without Spring). In my application I open Hibernate *session* in WebRequestCycle.* onBeginRequest*() and close it in WebRequestCycle.*onEndRequest*(). But having association (many-to-one mappings between classes) I've got LazyInitializationException (no Session). I've just set parameter "*lazy*"=false in hibernate mapping file to "many-to-one" mappings. And it worked fine - amount of data stored in memory in this case was not critical. Since the system is growing furhter, the method with no lazy initialization is no more suitable. Could you, please, advise me a way to handle hibernate session to have lazy initialization. (Solution with no Spring is preferable). // Best regards, Anton