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


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to