Re: [CDBI] objects not updated in memory

[prev] [thread] [next] [Date index for 2005/10/27]

From: Patrik Wallstrom
Subject: Re: [CDBI] objects not updated in memory
Date: 14:42 on 27 Oct 2005
On Wed, 26 Oct 2005, Perrin Harkins wrote:

> On Wed, 2005-10-26 at 11:30 +0200, Patrik Wallstrom wrote:
> > I have some classes which references objects which use Class::DBI,
> > more exactly, a session object which store a user object.
> 
> Don't put Class::DBI objects in a session.  If you need to store
> something in the session, store the ID.

That is not the problem here. Btw, why should I not store (serialize?)
CDBI-objects outside of the app?

> >     my $user_id = $self->user->id;
> >     $self->{'_user'}->remove_from_object_index();
> 
> What's that?  Is it the same as $self->user()?  This is pretty confusing
> code.

Yes, I have been moving around things in order to test them, it is the
same. user() is a method returning $self->{'_user'}.

> If you restored this User object from the session, it's not in the
> object index.

I tried everything that had to do with the object index, I know that
it's not the problem.

> > But ... even if I disable the Live object cache, I never get the
> > updated user from the database, and I can even see the query from the
> > database (and I update some records between reads).
> > 
> > Any clues on what is going on?
> 
> My guess would be some kind of scoping problem is tricking you about
> which object you are actually looking at.  Trying to write a simple test
> case for this might help you find the problem.  Or, it could be
> something to do with isolation levels in your database and visibility of
> committed data.  What database are you using?

MySQL 5.0.15. It might be the isolation level, which is quite
disturbing if it is. I must test this right now...

        -- 
        patrik_wallstrom->foodfight->pawal@xxxxx.xxx->+46-733173956

_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi

[CDBI] objects not updated in memory
Patrik Wallstrom 09:30 on 26 Oct 2005

Re: [CDBI] objects not updated in memory
Perrin Harkins 14:18 on 26 Oct 2005

Re: [CDBI] objects not updated in memory
Patrik Wallstrom 14:42 on 27 Oct 2005

Fwd: [CDBI] objects not updated in memory
Phil Mitchell 16:17 on 27 Oct 2005

Re: [CDBI] objects not updated in memory
Perrin Harkins 16:47 on 27 Oct 2005

Generated at 09:28 on 02 Nov 2005 by mariachi v0.52