hmmm. maybe my question was confusing.

my problem is that when the aso is created i inject my dao service. but
if the aso in serialized i lose both the object and the dao service. is
there another way of having the service re-injected into the aso when it
is unserialized?

On Tue, 2006-01-03 at 14:09 -0500, Jesse Kuhnert wrote:
> That's what I do...(more or less, still using dao like objects so session is
> hidden, but same concept with Session.load)
> 
> You should also make sure you are using second level caching (if you can
> afford it) to be sure commonly used objects aren't ~always~ reloaded
> directly from the db.
> 
> On 1/3/06, Patrick Casey <[EMAIL PROTECTED]> 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]

Reply via email to