> Den 19/01/2015 kl. 19.24 skrev Andreas Krueger <gro...@andreaskrueger.de>:
> 
> 
> 
> What is the most elegant way to
> 
> lock the Django DB while I make a complex transaction (read, decide, write)
> 
> ... during which no other uwsgi worker should have access (or at least no 
> write access) to that table?

That's a rather strange requirement. What are you trying to achive? Elegant for 
who?

You could put your site in "maintenance mode" while the process is running, to 
be nice to users. If you mean elegant (as in simple) sysadmin-wise, simply shut 
down uwsgi and run your commands in a custom management command while uwsgi is 
stopped.

But if you can bundle all your tasks in a single DB transaction, you shouldn't 
need to shut down anything.

Erik

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/036DAEA0-9F6F-4AD3-9A3C-03D5DC14C00A%40cederstrand.dk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to