On Nov 9, 2009, at 9:34 PM, Continuation wrote:
> Also does django middleware acquire database lock on my behalf, or do
> I need to explicitly perform the locking?

In the example code, it's the SELECT ... FOR UPDATE that acquires the  
lock.  Django doesn't currently have any explicit knowledge of  
locking, so you need to drop down to the custom SQL level to issue the  
right statement to acquire the lock on the row.

The example I wrote assumed you were using PostgreSQL as the backend;  
you can get all sorts of details about locking in PostgreSQL here:

        
http://www.postgresql.org/docs/8.4/interactive/explicit-locking.html#LOCKING-ROWS
--
-- Christophe Pettus
    x...@thebuild.com


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to