You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by George Christman <gc...@cardaddy.com> on 2015/03/27 19:50:41 UTC

Passing hibernate session from one page to the next in a wizard form

Hi guys, I'm trying to pass my object from one page to the next without
actually saving it. I tried putting the object in a sessionstate, but I'm
getting lazy loading exceptions on my second page, any idea how to do this?

Re: Passing hibernate session from one page to the next in a wizard form

Posted by George Christman <gc...@cardaddy.com>.
Thanks Ilya, that's another good idea I never gave a thought.

On Sun, Mar 29, 2015 at 5:11 AM, Ilya Obshadko <il...@gmail.com>
wrote:

> Another solution to that is loading all lazy collections when you retrieve
> your object and before starting using in in a session. You can force it
> using Hibernate Criteria method setFetchMode ( "collectionName",
> FetchMode.JOIN ).
>
> On Fri, Mar 27, 2015 at 10:44 PM, George Christman <
> gchristman@cardaddy.com>
> wrote:
>
> > You are the man, been struggling with this all day ugh. Thanks a lot.
> >
> > On Fri, Mar 27, 2015 at 3:17 PM, Kalle Korhonen <
> > kalle.o.korhonen@gmail.com>
> > wrote:
> >
> > > On Fri, Mar 27, 2015 at 11:50 AM, George Christman <
> > > gchristman@cardaddy.com>
> > > wrote:
> > >
> > > > Hi guys, I'm trying to pass my object from one page to the next
> without
> > > > actually saving it. I tried putting the object in a sessionstate, but
> > I'm
> > > > getting lazy loading exceptions on my second page, any idea how to do
> > > this?
> > > >
> > >
> > > It's generally not a good idea but it's possible. You need to watch for
> > > memory consumption. Adding an already attached object to the session
> can
> > > have adverse effects on memory consumption. Typically, you want to
> detach
> > > the object from the first session and reattach the object to the second
> > > session. I've written about the subject at
> > > http://tynamo.org/tapestry-conversations+guide.
> > >
> > > Kalle
> > >
> >
> >
> >
> > --
> > George Christman
> > CEO
> > www.CarDaddy.com
> > P.O. Box 735
> > Johnstown, New York
> >
>
>
>
> --
> Ilya Obshadko
>



-- 
George Christman
CEO
www.CarDaddy.com
P.O. Box 735
Johnstown, New York

Re: Passing hibernate session from one page to the next in a wizard form

Posted by Ilya Obshadko <il...@gmail.com>.
Another solution to that is loading all lazy collections when you retrieve
your object and before starting using in in a session. You can force it
using Hibernate Criteria method setFetchMode ( "collectionName",
FetchMode.JOIN ).

On Fri, Mar 27, 2015 at 10:44 PM, George Christman <gc...@cardaddy.com>
wrote:

> You are the man, been struggling with this all day ugh. Thanks a lot.
>
> On Fri, Mar 27, 2015 at 3:17 PM, Kalle Korhonen <
> kalle.o.korhonen@gmail.com>
> wrote:
>
> > On Fri, Mar 27, 2015 at 11:50 AM, George Christman <
> > gchristman@cardaddy.com>
> > wrote:
> >
> > > Hi guys, I'm trying to pass my object from one page to the next without
> > > actually saving it. I tried putting the object in a sessionstate, but
> I'm
> > > getting lazy loading exceptions on my second page, any idea how to do
> > this?
> > >
> >
> > It's generally not a good idea but it's possible. You need to watch for
> > memory consumption. Adding an already attached object to the session can
> > have adverse effects on memory consumption. Typically, you want to detach
> > the object from the first session and reattach the object to the second
> > session. I've written about the subject at
> > http://tynamo.org/tapestry-conversations+guide.
> >
> > Kalle
> >
>
>
>
> --
> George Christman
> CEO
> www.CarDaddy.com
> P.O. Box 735
> Johnstown, New York
>



-- 
Ilya Obshadko

Re: Passing hibernate session from one page to the next in a wizard form

Posted by George Christman <gc...@cardaddy.com>.
You are the man, been struggling with this all day ugh. Thanks a lot.

On Fri, Mar 27, 2015 at 3:17 PM, Kalle Korhonen <ka...@gmail.com>
wrote:

> On Fri, Mar 27, 2015 at 11:50 AM, George Christman <
> gchristman@cardaddy.com>
> wrote:
>
> > Hi guys, I'm trying to pass my object from one page to the next without
> > actually saving it. I tried putting the object in a sessionstate, but I'm
> > getting lazy loading exceptions on my second page, any idea how to do
> this?
> >
>
> It's generally not a good idea but it's possible. You need to watch for
> memory consumption. Adding an already attached object to the session can
> have adverse effects on memory consumption. Typically, you want to detach
> the object from the first session and reattach the object to the second
> session. I've written about the subject at
> http://tynamo.org/tapestry-conversations+guide.
>
> Kalle
>



-- 
George Christman
CEO
www.CarDaddy.com
P.O. Box 735
Johnstown, New York

Re: Passing hibernate session from one page to the next in a wizard form

Posted by Kalle Korhonen <ka...@gmail.com>.
On Fri, Mar 27, 2015 at 11:50 AM, George Christman <gc...@cardaddy.com>
wrote:

> Hi guys, I'm trying to pass my object from one page to the next without
> actually saving it. I tried putting the object in a sessionstate, but I'm
> getting lazy loading exceptions on my second page, any idea how to do this?
>

It's generally not a good idea but it's possible. You need to watch for
memory consumption. Adding an already attached object to the session can
have adverse effects on memory consumption. Typically, you want to detach
the object from the first session and reattach the object to the second
session. I've written about the subject at
http://tynamo.org/tapestry-conversations+guide.

Kalle