Re: [CDBI] objects not updated in memory
[prev]
[thread]
[next]
[Date index for 2005/10/26]
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.
> 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.
If you restored this User object from the session, it's not in the
object index.
> 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?
- Perrin
_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi
|
|
Re: [CDBI] objects not updated in memory
Perrin Harkins 14:18 on 26 Oct 2005
|