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

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
31b99d6503ae4b6f4fe9f26a0cc630bd?d=identicon&s=25 Tom Riley (Guest)
on 2006-04-21 16: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 Luetke]


Maybe I have switched this behaviour off somehow?

Any help, much appreciated,
Cheers,

Tom
This topic is locked and can not be replied to.