I''ve been developing a rails application in development mode for a few weeks, and the backend database logic was working well. Now I''m switching to a shared host (hostingrails.com), and tried to run in production mode, just to find that the behaviour is so different from development mode, and I''m facing serious problem. The most crucial difference is in database. In development mode, every change in database record takes effect immediately when the record is saved. Say I changed a comment from "Hello world!" to "Hello!", then next time I query this comment, I''ll get "Hello!", not "Hello world!". But in production mode in the shared host, what I''m getting is "Hello world!" even after I saved this record. This behaviour is really undesirable, since the application relies on real-time data. I''m guessing that in shared host, they optimized the database query so that it''s cached somehow. Could anybody point out why this is happening? And how to disable the caching of database query in production mode? Or any suggestions? Thanks, Dongzhen Piao. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Frederick Cheung
2010-Jan-31 04:58 UTC
Re: Record not saved immediately in production mode
On Jan 31, 1:33 am, parkurm <park...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> But in production mode in the shared host, what I''m getting is "Hello > world!" even after I saved this record. This behaviour is really > undesirable, since the application relies on real-time data. I''m > guessing that in shared host, they optimized the database query so > that it''s cached somehow. > > Could anybody point out why this is happening? And how to disable the > caching of database query in production mode? Or any suggestions? >It would help to see some code. In development mode your whole app is reloaded between requests, which can mask some issues. Fred -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.