Hi Eelco

Appreciate your time and thoughts. I guess I am going to have to look at LDM
approach, since from what yourself,James and Dan have already mentioned
that.
I noticed a pattern when it/the system throws the Exception I have to track
it closely and see if makes sense and then I guess have to refactor to use a
LDM.Still hazy to me.
Many thanks for the time and thoughts, much appreciated one and all.

Regards
Nivedan




On Sat, Dec 4, 2010 at 9:23 AM, Eelco Hillenius
<[email protected]>wrote:

> Yep, or least something comparable. You need to re-attach those
> objects you're using to the session somehow, and often the easiest way
> to do that is to just load them again if they were previously
> detached. If you worry about the database being hit more than you
> want, you are probably prematurely optimizing, and if you still worry,
> you should fix this by through Hibernate's (or your own) second level
> cache, not by keeping your model objects inflated between requests.
>
> As a general rule, something we often repeat on this list, if you work
> with Hibernate managed objects in Wicket models, use detachable models
> (LDM is a common one) and make sure that these objects are 'deflated'
> between requests, meaning that e.g. you only keep references to their
> ids, or e.g. the algorithm to get the objects back again when needed.
>
> Eelco
>
>
> On Wed, Dec 1, 2010 at 10:13 PM, James Carman
> <[email protected]> wrote:
> > Just make sure your form's model is a LDM too.
> >
> > On Thu, Dec 2, 2010 at 12:23 AM, Nivedan Nadaraj <[email protected]>
> wrote:
> >> Hi All
> >>
> >> I am guessing this is more of a Hibernate thing/issue but if some one
> has
> >> encountered this and has a explanation that I can probably use from the
> >> Wicket front would be great.
> >>
> >> https://forum.hibernate.org/viewtopic.php?f=1&t=1008473
> >>
> >>
> >> I have a LazyIntializationException when i page through some items. I
> use
> >> the PageableListView, the List item(s) are entities that are retrieved
> via
> >> an association Person.phones which is  a Set type.
> >> The funny thing is, the LIException is intermittent. I am also using
> >> OpenSessionInViewFilter. Any thoughts?
> >>
> >> By the way the this is the load() implemenation, I have set the Model
> >> Object's phoneList with a list of values fetched via the Service->DAO. I
> >> have used this with other entities without association and it works  but
> I
> >> guess is a different scenario(not associations)
> >>
> >> Model = new LoadableDetachableModel<Object>() {
> >>    @Override
> >>            protected Object load() {
> >>                return containerForm.getModelObject().getPhoneList();
> >>            }
> >>        };
> >> }
> >>
> >> If someone has any thoughts would appreiciate hearing from you.
> >>
> >>
> >> Cheers
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [email protected]
> > For additional commands, e-mail: [email protected]
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to