I have a rails app that has a sync feature which looks up a remote
updates the local database accordingly. Anyway, things work great for
part, but there is a section of code which seems to randomly raise
have something like this:
homelinks = Syncinventorydesc.find(:all)
for link in homelinks
locallink = InventoryDescription.new() locallink.inventory_id = link.inventory_id locallink.description_id = link.description_id locallink.save!
this code tears down the local table completely before going through
fetched on the remote db and inserting them in. Every now and then i get
duplicate error message (there a no duplicate keys in the original
suggests that either not all records are getting wiped out of the local
a record is getting saved twice somehow… both seem very unlikely.
i have wrapped the locallink.save! in a rescue block to let the
which should silence this problem, but the mystery remains. Anybody know