Hi guys, Has ActiveRecord 3 a more complex cache mechanism than version released with Ruby on Rails 2.0 ? And has ActiveRecord the concept of "scope of object identity?" obj1 = MyModel.find(1) obj2 = MyModel.find(1) results in two selects and two different object in memory, why? Where I could find clear and detailed info about these topics? -- Posted via http://www.ruby-forum.com/. -- 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.
On Feb 21, 2:11 pm, Vogon Primo <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hi guys, > Has ActiveRecord 3 a more complex cache mechanism than version released > with Ruby on Rails 2.0 ? > > And has ActiveRecord the concept of "scope of object identity?" > > obj1 = MyModel.find(1) > obj2 = MyModel.find(1) > > results in two selects and two different object in memory, why? >Because it''s not trying to do anything different (the select itself will be cached). The subject comes up every now and again, but activerecord does not yet have an identity map Fred> Where I could find clear and detailed info about these topics? > > -- > Posted viahttp://www.ruby-forum.com/.-- 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.
Quoting Vogon Primo <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>:> Hi guys, > Has ActiveRecord 3 a more complex cache mechanism than version released > with Ruby on Rails 2.0 ? > > And has ActiveRecord the concept of "scope of object identity?" > > obj1 = MyModel.find(1) > obj2 = MyModel.find(1) > > results in two selects and two different object in memory, why? > > Where I could find clear and detailed info about these topics? >The objects are the results of selects. Some other program may have changed the value in between. So the values may be different. Rails does know what other programs are accessing the database. Only the database server knows. And it can cache the result. So two calls to the DB, possibly two different results. Jeffrey -- 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.