I don't think I'm understanding your question here. To restore the
object you need precisely two datums of information: Its class, and its
unique identifier. You don't need to store the session or any kind of DAO if
you don't want to (although I usually store the DAOs because it keeps the
sessions out of the gui).

        --- Pat

> -----Original Message-----
> From: Dan Adams [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, January 03, 2006 11:14 AM
> To: Tapestry users
> Subject: RE: dealing with optimizing ASOs
> 
> Well, i'm using session-per-view and I don't want to have to change my
> services to have to know about their being serialized. Besides, doesn't
> serializing the service kind of defeat the point of not serializing the
> object the service is loading?
> 
> On Tue, 2006-01-03 at 11:06 -0800, Patrick Casey wrote:
> >     Can't you just get a new session e.g.
> >
> >     Session s = getSession();
> >     If (s == null)
> >             s = MySessionFactory.openSession();
> >     Object MyReloadedObject = s.load(MyClass.class, MyId);
> >
> >     --- Pat
> >
> > > -----Original Message-----
> > > From: Dan Adams [mailto:[EMAIL PROTECTED]
> > > Sent: Tuesday, January 03, 2006 11:07 AM
> > > To: Tapestry users
> > > Subject: dealing with optimizing ASOs
> > >
> > > Okay, so I have an ASO which holds an object. Now, for efficiency I
> made
> > > the object transient and also stored the objects id (id is the primary
> > > key). If the object is null it tries to reload the object using id.
> The
> > > problem with doing this is that the ASO has to store the dao service
> > > which it uses to get the object by id. But it can't store the service
> > > (because it is associated with a hibernate session and because that
> > > wouldnt really save on space) so when the ASO is unserialized both the
> > > object and the service is null so now I can't get the object back by
> id
> > > because I don't have the service. Anyone have a good solution to this?
> > >
> > > --
> > > Dan Adams
> > > Software Engineer
> > > Interactive Factory
> > >
> > >
> > > ---------------------------------------------------------------------
> > > 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]
> >
> --
> Dan Adams
> Software Engineer
> Interactive Factory
> 
> 
> ---------------------------------------------------------------------
> 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