Hi,
I want to write a large number of model instances to DB, in a multi-database setup. The way I am doing this is essentially:
@transaction.atomic
def process_all():
for record in Model.objects.using(DB1).all():
process_one(record)
def process_one(record):
do_something_with(record)
record.save(using=DB2)
Neither ATOMIC_REQUESTS nor AUTOCOMMIT are touched in the settings. FWIW, I use a Postgres DB and Django 1.7.8. Also, if I replace the @transactions.atomic decorator with: with transactions.atomic() do: ..., that doesn't change anything.
What am I missing?
Thanks, Lene