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

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

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

George Christman
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?
Reply | Threaded
Open this post in threaded view
|

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

Kalle Korhonen-2
On Fri, Mar 27, 2015 at 11:50 AM, George Christman <[hidden email]>
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
Reply | Threaded
Open this post in threaded view
|

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

George Christman
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 <[hidden email]>
wrote:

> On Fri, Mar 27, 2015 at 11:50 AM, George Christman <
> [hidden email]>
> 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
Reply | Threaded
Open this post in threaded view
|

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

Ilya Obshadko-2
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 <[hidden email]>
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 <
> [hidden email]>
> wrote:
>
> > On Fri, Mar 27, 2015 at 11:50 AM, George Christman <
> > [hidden email]>
> > 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
Reply | Threaded
Open this post in threaded view
|

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

George Christman
Thanks Ilya, that's another good idea I never gave a thought.

On Sun, Mar 29, 2015 at 5:11 AM, Ilya Obshadko <[hidden email]>
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 <
> [hidden email]>
> 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 <
> > [hidden email]>
> > wrote:
> >
> > > On Fri, Mar 27, 2015 at 11:50 AM, George Christman <
> > > [hidden email]>
> > > 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