[CDBI] objects not updated in memory

Patrik Wallstrom pawal at blipp.com
Wed Oct 26 10:30:45 BST 2005


I have some classes which references objects which use Class::DBI,
more exactly, a session object which store a user object.

In a function which checks to see if the user is still a valid user in
the system (sessions are supposed to last for a while), I want to
refresh the user from the database. This looks something like this:

if (time() - $self->{'_user.timestamp'} >
    my $user_id = $self->user->id;
    my $user = DB::User->retrieve($user_id);

    ... and some checks on the fresh User object.

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?

patrik_wallstrom->foodfight->pawal at blipp.com->+46-733173956

More information about the ClassDBI mailing list