Forum: Ruby on Rails Caching of collections/references on session?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Tom Riley (Guest)
on 2006-04-21 18:32
I'm using the user engine and therefore have a current_user User object
on my sessions. User has a collection called 'properties' and I am
accessing the Property objects via the current_user session variable and
also directly with Property.find. The problem I have is that rails seems
to be caching the properties collection over requests (I can see the
collection objects encoded the session files on disk). So after changing
a Property object via Property.find, I have stale data in my session.

I don't think this is supposed to be the default behaviour (I think
everything was fine before I upgraded to rails 1.1.2). I found this in a
change log for action pack:

Action Pack 1.1.0

* Added search through session to clear out association caches at the
end of each request. This makes it possible to place Active Record
objects in the session without worrying about stale data in the
associations (the main object is still subject to caching, naturally)
#347 [Tobias L.]

Maybe I have switched this behaviour off somehow?

Any help, much appreciated,

This topic is locked and can not be replied to.