# Class variables refreshed in development, but how exception\_notification does it?

**URL:** <https://www.ruby-forum.com/t/class-variables-refreshed-in-development-but-how-exception-notification-does-it/137420>\
**Category:** Rails\
**Created:** [May 13, 2008, 12:45am UTC](https://www.ruby-forum.com/t/class-variables-refreshed-in-development-but-how-exception-notification-does-it/137420 "2008-05-13T00:45:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mr\_tibs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/439d5e/32.png) [@mr\_tibs](https://www.ruby-forum.com/u/mr_tibs)\
**Post date:** [May 13, 2008, 12:45am UTC](https://www.ruby-forum.com/t/class-variables-refreshed-in-development-but-how-exception-notification-does-it/137420/1 "2008-05-13T00:45:54Z")

</div>

Hi,

I discovered today that Rails class variables are refreshed in  
development mode (because classes are reloaded). How else can you  
persist class variables in memory? I know it is possible, because the  
exception\_notification plugin does it.  
I don’t think they use session variables, because I dumped the session  
object and it looked like the info that I was looking for wasn’t  
there. They also don’t use a database.

Thanks,  
Tiberiu

---

<div class="post-metadata">

**Author:** ![mr\_tibs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/439d5e/32.png) [@mr\_tibs](https://www.ruby-forum.com/u/mr_tibs)\
**Post date:** [May 13, 2008, 12:51am UTC](https://www.ruby-forum.com/t/class-variables-refreshed-in-development-but-how-exception-notification-does-it/137420/2 "2008-05-13T00:51:10Z")

</div>

On 12 May 2008, at 23:45, Mr\_Tibs wrote:

> Hi,
> 
> I discovered today that Rails class variables are refreshed in  
> development mode (because classes are reloaded). How else can you  
> persist class variables in memory? I know it is possible, because the  
> exception\_notification plugin does it.  
> I don’t think they use session variables, because I dumped the session  
> object and it looked like the info that I was looking for wasn’t  
> there. They also don’t use a database.

If a file is in one of the paths listed in  
Dependencies.load\_once\_paths then the classes defined inside aren’t  
reloaded. By default this includes where plugins are.  
In general persisting class variables in memory (other than just for  
caching stuff) isn’t a great idea (because they aren’t shared across  
mongrels/ fastcgi instances /etc…)

Fred
