# Database is cached?

**URL:** <https://www.ruby-forum.com/t/database-is-cached/58304>\
**Category:** Rails\
**Created:** [April 20, 2006, 1:01pm UTC](https://www.ruby-forum.com/t/database-is-cached/58304 "2006-04-20T13:01:21Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![pete](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pete](https://www.ruby-forum.com/u/pete)\
**Post date:** [April 20, 2006, 1:01pm UTC](https://www.ruby-forum.com/t/database-is-cached/58304/1 "2006-04-20T13:01:21Z")

</div>

It appears that my database is cached.  
If I have a simple action which displays all records in a table it works  
fine, but if I then change one of the fields in the database using a  
MySQL GUI it is not reflected when I press refresh in the browser. Even  
if I clear the cache.  
The actual view is not being cached anyway becasue if I add some text to  
the view it is shown on refresh!

Is this normal or is something playing up?

---

<div class="post-metadata">

**Author:** ![pete](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pete](https://www.ruby-forum.com/u/pete)\
**Post date:** [April 20, 2006, 2:42pm UTC](https://www.ruby-forum.com/t/database-is-cached/58304/2 "2006-04-20T14:42:57Z")

</div>

pete wrote:

> It appears that my database is cached.  
> If I have a simple action which displays all records in a table it works  
> fine, but if I then change one of the fields in the database using a  
> MySQL GUI it is not reflected when I press refresh in the browser. Even  
> if I clear the cache.  
> The actual view is not being cached anyway becasue if I add some text to  
> the view it is shown on refresh!
> 
> Is this normal or is something playing up?

Are you storing the item you’re checking for updates in the session?  
That would be a sure way to pull your hair out looking for changes when  
you won’t get any.

---

<div class="post-metadata">

**Author:** ![pete](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pete](https://www.ruby-forum.com/u/pete)\
**Post date:** [April 20, 2006, 2:49pm UTC](https://www.ruby-forum.com/t/database-is-cached/58304/3 "2006-04-20T14:49:42Z")

</div>

if you are not in development mode, you have to restart your web-server

also, I assume that your code is generic and should display all the  
columns

---

<div class="post-metadata">

**Author:** ![pete](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pete](https://www.ruby-forum.com/u/pete)\
**Post date:** [April 20, 2006, 6:28pm UTC](https://www.ruby-forum.com/t/database-is-cached/58304/4 "2006-04-20T18:28:10Z")

</div>

Kris wrote:

> No they are not in the session, its a direct database call, normal  
> scaffold.
> 
> “if you are not in development mode, you have to restart your  
> web-server”
> 
> I’m in development mode.
> 
> ??

I used MySQL Front for a while before realising that you have to press  
the little green tick button to make sure the tables are updating after  
edits. Anything like that?

---

<div class="post-metadata">

**Author:** ![pete](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pete](https://www.ruby-forum.com/u/pete)\
**Post date:** [April 21, 2006, 12:16pm UTC](https://www.ruby-forum.com/t/database-is-cached/58304/5 "2006-04-21T12:16:53Z")

</div>

Daniel L. wrote:

> Kris wrote:
> 
> > No they are not in the session, its a direct database call, normal  
> > scaffold.
> > 
> > “if you are not in development mode, you have to restart your  
> > web-server”
> > 
> > I’m in development mode.
> > 
> > ??
> 
> I used MySQL Front for a while before realising that you have to press  
> the little green tick button to make sure the tables are updating after  
> edits. Anything like that?

I dont think so, I use SQLyog and have done for a while now.  
Maybe I give it a few days and see if the problem goes…

---

<div class="post-metadata">

**Author:** ![pete](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pete](https://www.ruby-forum.com/u/pete)\
**Post date:** [April 21, 2006, 4:09pm UTC](https://www.ruby-forum.com/t/database-is-cached/58304/6 "2006-04-21T16:09:54Z")

</div>

So, are you changing the table structure (adding/renaming fields) and  
then trying to see a difference in like a scaffold edit or new page?  
Those fields are pulled out of the database when you generate your  
scaffold, and they won’t automatically update if you change your  
underlying structure.

---

<div class="post-metadata">

**Author:** ![pete](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pete](https://www.ruby-forum.com/u/pete)\
**Post date:** [April 20, 2006, 6:08pm UTC](https://www.ruby-forum.com/t/database-is-cached/58304/7 "2006-04-20T18:08:18Z")

</div>

No they are not in the session, its a direct database call, normal  
scaffold.

“if you are not in development mode, you have to restart your  
web-server”

I’m in development mode.

??
