Pitr Vernigorov
2013-Jan-15 19:17 UTC
using ActiveRecord''s query_cache for fun and profit
I need to store some data on a request basis and I was wondering how BAD would it be to just stick it into ActiveRecord''s query_cache. The way I see it, all the hard stuff is already done, like thread-safety. Suggestions? ActiveRecord::Base.connection.query_cache[''some''][''var''] = 42 # later ActiveRecord::Base.connection.query_cache[''some''][''var''] Thank you. -- 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 To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/uQ_KbpwKgYcJ. For more options, visit https://groups.google.com/groups/opt_out.
Dheeraj Kumar
2013-Jan-16 03:54 UTC
Re: using ActiveRecord''s query_cache for fun and profit
Why not stick it into the session? -- Dheeraj Kumar On Wednesday 16 January 2013 at 12:47 AM, Pitr Vernigorov wrote:> I need to store some data on a request basis and I was wondering how BAD would it be to just stick it into ActiveRecord''s query_cache. The way I see it, all the hard stuff is already done, like thread-safety. Suggestions? > > ActiveRecord::Base.connection.query_cache[''some''][''var''] = 42 > # later > ActiveRecord::Base.connection.query_cache[''some''][''var''] > > Thank you. > > -- > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org (mailto:rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org). > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org (mailto:rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org). > To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/uQ_KbpwKgYcJ. > For more options, visit https://groups.google.com/groups/opt_out. > >-- 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 https://groups.google.com/groups/opt_out.