koicat
2010-Apr-13 01:53 UTC
Need to turn off caching of associative table: statuses getting scrambled
Am in development mode. I have an associative table (scripts_runs) (has_many, through) that carries a status column (''started'', ''ready to parse'', ''completed'' ). The started and ready to parse states are signaled by ''flag'' files from distributed executions of the scripts pickedup periodically (20 seconds). The completed status is written directly to the associative table by the parser when it is done. With short scripts the complete status is written before the ready to parse flag file is picked up. Because the row from the table is cached, the complete status is not seen by the observer for the flag files and gets overwritten by the ready to parse status. This is not good. I need the status to be updated in the database in the correct sequence so an Ajax periodic query can inform the user of the status of each script and when the run ( consisting of one to many scripts ) is completed. My observer is checking the ScriptRun status and trying to avoid changing it if it is already complete... Can I force the ScriptRun.find(:id) to always go to the database? If so how? If not, why not??? -- 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.