Displaying 1 result from an estimated 1 matches for "databaseseemstoodamnbusy".
2006 Aug 16
1
Stale object errors
...num_attempts>0
begin
yield # the block should do something along the lines of
Message.update(blah)
break # If we got here, we didn''t raise a stale object error
rescue ActiveRecord::StaleObjectError => e
num_attempts -= 1
end
end
raise DatabaseSeemsTooDamnBusy if num_attempts==0
end
...but it feels like I''m missing something - does Rails supply any
functionality to do this for me? Any suggestions on how to improve
the above?